Closed Vasyl-Za closed 5 years ago
@Vasyl-Za The trick is in props
The original F# sample do it like this
let props = Properties()
props.setProperty("ner.useSUTime","0") |> ignore
let sent : Sentence = new Sentence("Lucy is in the sky with diamonds.")
let nerTags : List = sent.nerTags(props); // <---- uses props
in your C# sample you do not pass them to the function
var netTags = sent.nerTags();
this line should look like
var netTags = sent.nerTags(props);
I do not know the root cause but use of SUTime
for ner
does not work out-of-the-box in .NET version. The easiest fix is to turn this off
@sergey-tihon - Many thanks! My fault: missed props as an argument - your F# code does have it.
This is regarding Sergey Tihon's sample published here:
Simple CoreNLP http://sergey-tihon.github.io/Stanford.NLP.NET//samples/CoreNLP.Simple.html
Equivalent C# code:
throws an exception:
Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl
at the line:
var netTags = sent.nerTags();
jarRoot and models are correct and present: if you comment out offending line
var netTags = sent.nerTags();
, the followingstring firstPOSTag = sent.posTag(0);
works fine.