i need to find the opinion of certain reviews given in websites. i am using sentiwordnet for this. i first send the file containing all the reviews to POS Tagger.
tokens=nltk.word_tokenize(line) #tokenization for line in file
tagged=nltk.pos_tag(tokens) #for POSTagging
print tagged
Is there any other accurate way of tokenizing which considers not good as 1 word other than considering it as 2 separate words.
Now i have to give postive and negative score to the tokenized words and then calculate the total score. Is there any function in sentiwordnet for this. please help.
See First Extract Adverbs and Adjectives from review for example:
Now you must have a external csv file in which you should have positive and negative words
like : wrinkle,neg wrinkled,neg wrinkles,neg masterfully,pos masterpiece,pos masterpieces,pos
Working of the above script as follows:
1 . read sentence 2 . extract adverb and adjectives 3 . compare to CVS for positive and negative words 4 . and then rate the sentence
Result of above script is :
change result as per your need. and sorry for my english :P