CoreNLP(Java)を使用して、多数の製品レビューでセンチメント分析を実行しようとしています。全体として、私は、分析の精度がかなり良いと感じました。私が読んだところから、私が使用しているモデルは、最初は映画レビューを使って作成されていたので、製品のレビューを分析するのに100%適していません。私は、分析の精度を "向上"させる最善の方法を考えていました。CoreNLPセンチメント解析結果を「強化する」
私が考えていた主な点は、製品のレビューのテキストに加えて、ユーザーが提供する星評価もあることです。値は1〜5の範囲で、1つの星が最低です。感情スコアを生成するときに星の評価を考慮する方法があることを望んでいました。特定の商品に対するユーザーの気持ちをより正確に反映するからです。 CoreNLPでの感情分析スコアリングにスター格率因子をもっとも効果的に使う方法がありますか?
List<ProductReview> reviews = this.reviewRepository.findAll();
for (ProductReview review : reviews) {
Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref, sentiment");
props.put("ner.model", "edu/stanford/nlp/models/ner/english.all.3class.distsim.crf.ser.gz");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
int starRating = review.getStarRating();
String reviewText = review.getTitle() + " : " + review.getReviewText();
if (!StringUtils.isEmpty(reviewText)) {
int longest = 0;
int mainSentiment = 0;
Annotation annotation = pipeline.process(reviewText);
String sentimentStr = null;
List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);
for (CoreMap sentence : sentences) {
Tree sentimentTree = sentence.get(SentimentCoreAnnotations.SentimentAnnotatedTree.class);
int sentiment = RNNCoreAnnotations.getPredictedClass(sentimentTree) - 2;
String partText = sentence.toString();
if (partText.length() > longest) {
mainSentiment = sentiment;
sentimentStr = sentence.get(SentimentCoreAnnotations.SentimentClass.class);
longest = partText.length();
}
}
}
}
どのように私は最高のスター評価組み込むことができる(最も有用な製品レビューなどの投票として、あるいは他の情報を、など)CoreNLPによって実行されている分析へ:私の解析コードは次のようになりますか?私は別にやるべきことですか?または追加のデータをセンチメント分析エンジンに直接組み込む方法はありますか?