2016-10-25 1 views
1

Ich versuche eine Sentimentanalyse in Spanisch mit Stanford CoreNLP durchzuführen.Stanford coreNLP Sentimentanalyse für Spanisch

Ist es möglich, Sentiment Annotator auch in Spanisch zu verwenden?

Bis jetzt geändert I 'spanish.properties':

annotators = tokenize, ssplit, pos, parse, sentiment 

tokenize.language = es 

sentiment.model = edu/stanford/nlp/international/spanish 

pos.model = edu/stanford/nlp/models/pos-tagger/spanish/spanish-distsim.tagger 

ner.model = edu/stanford/nlp/models/ner/spanish.ancora.distsim.s512.crf.ser.gz 
ner.applyNumericClassifiers = false 
ner.useSUTime = false 

parse.model = edu/stanford/nlp/models/lexparser/spanishPCFG.ser.gz 


> initCoreNLP(type = "spanish") 

[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Searching for resource: StanfordCoreNLP-spanish.properties 
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator tokenize 
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator ssplit 
[main] INFO edu.stanford.nlp.pipeline.StanfordCoreNLP - Adding annotator pos 
Error in rJava::.jnew("edu.stanford.nlp.pipeline.StanfordCoreNLP",  basename(path)) : 
    java.lang.RuntimeException: edu.stanford.nlp.io.RuntimeIOException: Error while loading a tagger model (probably missing model file) 

ich diesen Fehler habe und auch die Ergebnisse nicht korrekt

> text <- c("Estoy feliz.", "Estoy triste." , "No me gusta eso." ,"Estoy enojado.") 
> string.text <- annotateString(text) 
> getSentiment(string.text) 
    id sentimentValue sentiment 
1 1    2 Neutral 
2 2    3 Positive 
3 3    1 Negative 
4 4    2 Neutral 

Könnten Sie mir bitte helfen, wie ich durchführen kann Spanische Sentimentanalyse in Stanford coreNLP?

Antwort

0

Leider unterstützt Stanford CoreNLP keine Stimmungsanalyse für Spanisch. Sie müssen anderswo nach Stimmungsdaten/vortrainierten Modellen auf Spanisch suchen.

(Der eigentliche Fehler, den Sie sehen, ist, dass die POS-Tagger ist nicht auf Ihrem Classpath. Stellen Sie sicher, dass Sie die separate spanischen Modelle JAR heruntergeladen haben (auf der CoreNLP Website), und dass es auf Ihrem Classpath ist.)

Verwandte Themen