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

Sentiment Analysis #2

Open
rajarameshmamidi opened this issue Jan 9, 2020 · 2 comments
Open

Sentiment Analysis #2

rajarameshmamidi opened this issue Jan 9, 2020 · 2 comments

Comments

@rajarameshmamidi
Copy link

Hi Brain,

I gone through your course 'Introduction to Natural Language' in Udemy. It was very helpful and your explanation is very interesting. i have started learning NLP and i have few doubts on sentiment analysis in one of the project which you explain in the course related to positive and negative word analysis.
Is it possible to analysis positive and negative word without word_positive.csv and word_negative.csv?

your help is much appreciated.
Thanks,
raja

@bsacash
Copy link
Owner

bsacash commented Jan 9, 2020 via email

@rajarameshmamidi
Copy link
Author

Thank you... Brain.

i have build below code with the help of udemy course , googling and understood till bag-of-words using sklearn countvectorizer. Now, i confused how to split the data into train and test sets. The file which i am trying doesn't have any label information and i am interested to perform sentiment analysis on this data. could you please let me know how to split the data into train set and test set to perform sentiment analysis with various ML Algorithms.

in below code i have included CountVectorizer information as i am passing the data after performing pre-processing steps.

from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
cv = CountVectorizer(stop_words = 'english')
dtm = cv.fit_transform(data)

here is the file which i am trying to perform sentiment analysis.
modi_speech.txt

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