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

information about sentiment analysis algorithm #415

Open
DSLituiev opened this issue Jan 20, 2023 · 2 comments
Open

information about sentiment analysis algorithm #415

DSLituiev opened this issue Jan 20, 2023 · 2 comments

Comments

@DSLituiev
Copy link

Is any information available such as publication or corpus used for training?

@DSLituiev
Copy link
Author

related to a question in issue #412

@Deepankar-98
Copy link

Deepankar-98 commented Feb 17, 2023

Internal working of TextBlob Sentiment Analysis Library:

Pattern Sentiment Analysis library is used by Textblob internally for sentiment Analysis. Pattern is a rule based algorithm and it uses knowledge base defined in en-sentiment.xml file for English language.

You can refer this video for more details on how textblob sentiment score is calculated:
https://www.youtube.com/watch?v=Y8iNez1tCx8

Sentiment score database -- https://github.com/sloria/TextBlob/blob/6396e24e85af7462cbed648fee21db5082a1f3fb/textblob/en/en-sentiment.xml

You can add new words into this XML file based on your use-case and the word will get included and corresponding sentiment will be visible on reloading the environment.

For example lets add the word expedite:

<word form="expedite" pos="VB" sense="" polarity="-0.3" subjectivity="0.8" intensity="1.0" confidence="0.9" />

Then on reloading and re-running textblob.TextBlob.sentiment.polarity you will get polarity of -0.3

Textblob Sentiment analysis source code:

### SENTIMENT POLARITY LEXICON #####################################################################

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

2 participants