Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

probability of positive/negative with intensity #29

Open
Shubxam opened this issue Sep 27, 2024 · 1 comment
Open

probability of positive/negative with intensity #29

Shubxam opened this issue Sep 27, 2024 · 1 comment

Comments

@Shubxam
Copy link
Owner

Shubxam commented Sep 27, 2024

current "mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis" model, gives us a sentiment score for a headline.
image
in this example, the score of 0.99 tells us about the probability of the sentiment being negative, but doesn't tell us the magnitude of negativity i.e. how more of less negative the sentiment is.
How to fix that?

@Shubxam
Copy link
Owner Author

Shubxam commented Sep 27, 2024

solution by Claude:

To address the issue of determining the magnitude of negativity in addition to the probability, you can consider the following approaches:

  1. Use a multi-class classification model:
    Instead of binary classification (positive/negative), train a model to predict multiple classes representing different levels of sentiment (e.g., very negative, somewhat negative, neutral, somewhat positive, very positive). This would provide more granular sentiment information.

  2. Implement a regression model:
    Train a model to predict a continuous sentiment score (e.g., from -1 to 1) rather than discrete classes. This would directly give you both the direction and magnitude of sentiment.

  3. Calibrate probabilities:
    While not ideal, you could attempt to interpret the probability as a rough indicator of magnitude. However, this approach has limitations and may not be reliable.

  4. Ensemble methods:
    Combine multiple models or approaches to get a more nuanced view of sentiment, including both classification and regression models.

  5. Use lexicon-based methods alongside the model:
    Incorporate rule-based sentiment analysis using sentiment lexicons to supplement the model's output with more detailed sentiment information.

  6. Fine-tune on a dataset with magnitude labels:
    If possible, fine-tune your model on a dataset that includes sentiment magnitude labels, allowing it to learn to predict both sentiment direction and intensity.

To implement these solutions, you'd likely need to retrain or fine-tune your model, or incorporate additional models/techniques into your pipeline. The best approach depends on your specific requirements, available data, and resources.

Would you like me to elaborate on any of these approaches or discuss how you might implement one of them in your current setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant