Closed crack521 closed 9 years ago
Please try to turn of SUTime
props.setProperty("ner.useSUTime", "false") |> ignore
I changed the value of props as you suggested,but this error occurred again,What could I be doing wrong?
@crack521 Could you please paste your source code here? (So I was able to run it)
java.util.Properties props = new java.util.Properties();
var jarRoot = @"E:\codehub\java\stanford-corenlp-full-2015-04-20\stanford-corenlp-full-2015-04-20\stanford-corenlp-3.5.2-models\";
var modelsDirectory = jarRoot + @"\edu\stanford\nlp\models";
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
props.setProperty("ner.useSUTime", "0");
var curDir = Environment.CurrentDirectory;
Directory.SetCurrentDirectory(jarRoot);
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
Directory.SetCurrentDirectory(curDir);
String text = "Dan Ramage is working for\nMicrosoft. He's in Seattle! \n";
Annotation document = new Annotation(text);
pipeline.annotate(document);
var sentences = document.get(typeof(CoreAnnotations.SentencesAnnotation));
When the program runs,it occurs errors in the line of " StanfordCoreNLP pipeline = new StanfordCoreNLP(props);" An unhandled exception of type 'System.TypeInitializationException' occurred in stanford-corenlp-3.5.2.dll Additional information: The type initializer for 'edu.stanford.nlp.util.Timing' threw an exception
Change the culture in .NET to "US".
CultureInfo ci = new CultureInfo("en-US");
Thread.CurrentThread.CurrentCulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
tagger = new MaxentTagger(modelsDirectory + @"\french.tagger");
I had the same problem. On 2 computers it works fine and on 2 other it does not. So I figured it was something in the environment related to time, so I changed the culture. I am working with the POS tagger for French text.
@toncho11 Thanks a lot!
@toncho11 Thank you for help. @crack521 Please close this issue if the it is resolved
Hello, I am trying to run through your example code, and I ran into this error: An unhandled exception of type 'System.TypeInitializationException' occurred in stanford-corenlp-3.5.2.dll Additional information: The type initializer for 'edu.stanford.nlp.util.Timing' threw an exception I copied your example exactly, and I am using 3.5.2. What could I be doing wrong?