-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
How to set language for CoreNLP Simple API #551
Comments
So, setting the properties manually should work (I'll look into why it doesn't), but easier is to use the class |
hi @gangeli and thanks for your respond. I saw
Maybe I am missing another import? |
What version of CoreNLP are you using? I believe it should be in 3.8.0, but I do know it's a relatively recent addition. |
@gangeli unfortunately I can't get CoreNLP 3.8 working with Spark 2.2. I have tested 3.6 and 3.7, but when I try to use 3.8 it always complain about Google protobuf:
So my CoreNLP is 3.7. I guess the FrenchSentence is in 3.8? PS: I created a separate issue for the Spark and 3.8 #556 |
@maziyarpanahi were you able to get the FrenchSentence and FrenchDocument working ? |
@gangeli I couldn't find the FrenchSentence and FrenchDocument class in the 3.8.0 release. I see sem in the latest version ( https://github.com/stanfordnlp/CoreNLP/blob/master/src/edu/stanford/nlp/simple/FrenchDocument.java). Is there another way to set the properties? ( or just change the language?) Thanks, |
Hi @J38 |
Hello, I'm having the same issue, I'm using 3.9. I don't think this issue should be closed, I see the code in the repository but can't load
|
I agree that this issue should be reopened -- I'm having the same issue as @poolebu |
I tried Simple API with the French language on both Stanford libraries versions 3.9.1 or 4.2.0 It works successfully import edu.stanford.nlp.simple.{Document, Sentence}
import edu.stanford.nlp.util.StringUtils;
var props=StringUtils.argsToProperties("-props", "StanfordCoreNLP-french.properties")
props.setProperty("annotators", "tokenize,ssplit,parse");
var x = "Das ist auch für die Bedingungen des Binnenmarktes von Wichtigkeit ."
var s = new Sentence(x, props)
s.posTags()
s.nerTags()
try { s.parse(props) } catch{ case _: Throwable => } finally { } // The first call parse alway error because of Graph null, so I found a work around solution by this line.
s.parse(props).pennString() and output:
|
Hi,
I am using Simple API in my Spark applications. It is very fast compare to normal pipeline/annotation. I was wondering how to set a different language for my POS tagger.
Here is how I use it for default English in Scala:
That's being said, I saw in the code there is option to pass properties for Simple API:
Even posTags can pas properties variable:
But neither works when I set fr as a language:
Does anyone know how to change language for Simple API?
Many thanks.
The text was updated successfully, but these errors were encountered: