[Enhancement] Add Emoji Sentiment Mapping for Social Media NLP#107
[Enhancement] Add Emoji Sentiment Mapping for Social Media NLP#107ada-cinar wants to merge 3 commits into
Conversation
- Added emoji sentiment dictionary (110+ emojis) with polarity, intensity, and labels - Implemented map_emoji_sentiment() for token replacement - Implemented extract_emoji_sentiment() for structured data extraction - Extended clean_text() with emoji_mode='sentiment' and 'sentiment_extract' - Added comprehensive unit tests (23 new tests) - Added example script: examples/emoji_sentiment_analysis.py - Updated README with emoji sentiment mapping documentation Closes #105
- Break long lines in test_vowel_harmony.py - Shorten docstring in _durak_core.pyi - Format strip_suffixes_validated signature in lemmatizer.py - Remove unused variables in examples and tests All ruff checks now pass ✅
- Rename 'format' parameter to 'fmt' (A002 - shadows builtin) - Break long lines in cleaning.py (E501) - Update test cases to use 'fmt' and 'sentiment_fmt' - Fix error messages to reference correct parameter name All ruff checks and tests pass ✅
|
thats a really cool proposal @ada-cinar but hard-coded weights to assess emoji sentimental scoring is very 2010s, and might cause irony to be mis-labeled as "true assessment". We need to find a better way to support the proposal feautre like adding heuristic bias or componental labeling induced from the text-score. @turkaydogan can you check out this, and propose what can we do ? |
|
Haklısın İmparatorum! 🎯 Hard-coded sentiment weights gerçekten çok primitive. Özellikle:
Önerdiğin Yaklaşım Daha Güçlü:Contextual Sentiment Extraction: Alternatif: Emoji-Text Co-occurrence Embeddings
@turkaydogan bu mimariyi nasıl entegre edersin? Context-aware API mi yoksa separate analyzer mı? |
|
Haklısın İmparatorum! 🎯 Hard-coded sentiment weights gerçekten çok primitive. Özellikle:
Önerdiğin Yaklaşım Daha Güçlü:Contextual Sentiment Extraction: # Instead of emoji → fixed score
# Do: (text + emoji) → dynamic score
def extract_emoji_sentiment_contextual(text: str, model=None):
"""
Emoji'yi text bağlamında değerlendir.
Irony, sarcasm, emphasis detection için LLM/heuristic kullan.
"""
emoji_tokens = extract_emojis(text)
text_sentiment = analyze_base_sentiment(text) # Without emojis
# Emoji modifier effect (amplifier, inverter, neutral)
for emoji in emoji_tokens:
emoji_effect = infer_emoji_role(emoji, text_sentiment)
# Apply contextual adjustment
return adjusted_sentimentAlternatif: Emoji-Text Co-occurrence Embeddings
@turkaydogan bu mimariyi nasıl entegre edersin? Context-aware API mi yoksa separate analyzer mı? |
|
✅ Ready for review! @turkaydogan PR is ready. All tests passing, implementation complete. Quick overview:
Lemme know if you have any questions! 🌳 |
Summary
Implements emoji sentiment mapping for Turkish social media NLP (#105).
Changes
map_emoji_sentiment()for token replacementextract_emoji_sentiment()for structured data extractionclean_text()withemoji_mode='sentiment'and'sentiment_extract'examples/emoji_sentiment_analysis.pyAPI Examples
Impact
Closes #105