i want to create a sentiment analysis program that takes in a dataset in Chinese and determine whether are there more of positive,negative or neutral statement. Following the example, i create a sentiment analysis for English (stanford-corenlp) which works exactly what i want but taking in Chinese.
Questions:
Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, parse, sentiment");
// gender,lemma,ner,parse,pos,sentiment,sspplit, tokenize
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
// read some text in the text variable
String sentimentText = "Fun day, isn't it?";
String[] ratings = {"Very Negative","Negative", "Neutral", "Positive", "Very Positive"};
Annotation annotation = pipeline.process(sentimentText);
for (CoreMap sentence : annotation.get(CoreAnnotations.SentencesAnnotation.class)) {
Tree tree = sentence.get(SentimentCoreAnnotations.AnnotatedTree.class);
int score = RNNCoreAnnotations.getPredictedClass(tree);
System.out.println("sentence:'"+ sentence + "' has a score of "+ (score-2) +" rating: " + ratings[score]);
System.out.println(tree);
Currently, i have no idea on how to change the above code to have it support Chinese Language. I downloaded the Chinese praser and segmenter and seen the demo. But after days of trying, it didn't lead to anywhere. I have also read the http://nlp.stanford.edu/software/corenlp.shtml, it is really useful for the English version. Is there any ebooks, tutorial or examples that can assist me on understanding how the Chinese sentiment analysis of Stanford NLP works ?
Thanks in advanced!
PS: I picked up java not too long ago, pardon me if there is some things that i did not say or done correctly.
What i had researched:
How to parse languages other than English with Stanford Parser? in java, not command lines