I am new to NLP and want an example to help me understand how to use the openie.triple.strict option under the openie property of the StanfordNLP parser.
The way to the same is:-
Properties props = new Properties();
props.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,parse,mention,coref, natlog, openie");
props.setProperty("openie.resolve_coref", "false"); //default = true
Thanks Gabor Angeli for the tip!
Here is an example command you can set the option to true or false. The default is true.
java -Xmx10g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,depparse,mention,natlog,openie -file sample-sentence.txt -outputFormat text -openie.triple.strict false
Related
I try to produce Latex documentation for my VHDL project.
It is alright for the most part except there are "Namespace Documentation" instead of "Package Documentation" and "Class Documentation" instead of "Entity Documentation".
I turned on optimize for VHDL.
Is it a bug or I am doing something wrong?
Edit: output of doxygen -x
# Difference with default Doxyfile 1.8.16 (cfd73d5c4d1a66c620a3b7c08b72a3f3c3f94
255*)
PROJECT_NAME = "2D DFT and Filtering"
PROJECT_BRIEF = "VHDL implementation of 2D DFT and Filtering"
OUTPUT_DIRECTORY = vhdl
FULL_PATH_NAMES = NO
OPTIMIZE_OUTPUT_VHDL = YES
INPUT = ../Vivado/Processing_System/Processing_System.srcs/sources_1/new
EXCLUDE = ../Vivado/Processing_System/Processing_System.srcs/sources_1/new/twiddle_factor_15x15.vhd
HTML_DYNAMIC_SECTIONS = YES
GENERATE_TREEVIEW = YES
I want to make some experiments with Stanford dcoref package on our conversational data. Our data contains usernames (speakers) and the utterances. Is it possible to give a structured data as input (instead of the raw text) to Stanford dcoref annotator? If yes, what should be the format of conversational input data?
Thank you,
-berfin
I was able to get this basic example to work:
<doc id="speaker-example-1">
<post author="Joe Smith" datetime="2018-02-28T20:10:00" id="p1">
I am hungry!
</post>
<post author="Jane Smith" datetime="2018-02-28T20:10:05" id="p2">
Joe Smith is hungry.
</post>
</doc>
I used these properties:
annotators = tokenize,cleanxml,ssplit,pos,lemma,ner,parse,coref
coref.conll = true
coref.algorithm = clustering
# Clean XML tags for SGM (move to sgm specific conf file?)
clean.xmltags = headline|dateline|text|post
clean.singlesentencetags = HEADLINE|DATELINE|SPEAKER|POSTER|POSTDATE
clean.sentenceendingtags = P|POST|QUOTE
clean.turntags = TURN|POST|QUOTE
clean.speakertags = SPEAKER|POSTER
clean.docIdtags = DOCID
clean.datetags = DATETIME|DATE|DATELINE
clean.doctypetags = DOCTYPE
clean.docAnnotations = docID=doc[id],doctype=doc[type],docsourcetype=doctype[source]
clean.sectiontags = HEADLINE|DATELINE|POST
clean.sectionAnnotations = sectionID=post[id],sectionDate=post[date|datetime],sectionDate=postdate,author=post[author],author=poster
clean.quotetags = quote
clean.quoteauthorattributes = orig_author
clean.tokenAnnotations = link=a[href],speaker=post[author],speaker=quote[orig_author]
clean.ssplitDiscardTokens = \\n|\\*NL\\*
Also this document has great info on the coref system:
https://stanfordnlp.github.io/CoreNLP/coref.html
I am looking into using the neural option on my example .xml document, but you might have to put your data into the conll format to run our neural coref with the conll settings. The conll data has conversational data with speaker info among other document formats.
This document contains info on the CoNLL format you'd have to use for the neural algorithm to work.
CoNLL 2012 format: http://conll.cemantix.org/2012/data.html
You need to create a folder with a similar directory structure (but you can put your files in instead)
example:
/Path/to/conll_2012_dir/v9/data/test/data/english/annotations/wb/eng/00/eng_0009.v9_auto_conll
If you run this command:
java -Xmx20g edu.stanford.nlp.coref.CorefSystem -props speaker.properties
with these properties:
coref.algorithm = clustering
coref.conll = true
coref.conllOutputPath = /Path/to/output_dir
coref.data = /Path/to/conll_2012_dir
it will write conll output files to /Path/to/output_dir
That command should read in all files ending with _auto_conll
The parser takes the flag -makeCopulaHead, how can I enable this flag on when using the CoreNLP server?
I've tried starting the server with the flag:
java -cp "*" -mx4g edu.stanford.nlp.pipeline.StanfordCoreNLPServer -parse.flags " -makeCopulaHead"
I have also tried passing it the param as part of the url params in my post request:
properties = {"annotators": "...", "parse.makeCopulaHead": "true"}
properties = {"annotators": "...", "makeCopulaHead": "true"}
properties = {"annotators": "...", "parse.flags.makeCopulaHead": "true"}
Edit, and attempts from answer:
properties = {"annotators": "...", "parse.flags": " -makeCopulaHead"}
properties = {"annotators": "...", "parse.flags": "makeCopulaHead"}
The right way to do this is the second: pass in the flags as properties = {...} entries. I don't actually know how this particular flag works, but it does seem like the equivalent to your command-line invocation would be:
properties = {"annotators": "...", "parse.flags": " -makeCopulaHead"}
Perhaps that'll work?
EDIT: The -parse.flags option will only work if you're using the constituency parser + dependency converter (annotator parse) rather than the neural dependency parser (annotator depparse).
as i know checkstyle creates two types of report, xml and plain text. Which parameter i should update to make report as xml?
example xml output
java com.puppycrawl.tools.checkstyle.Main -c docs/sun_checks.xml \
-f xml -o build/checkstyle_errors.xml Check.java
Ok, answer found, create reportsDir property in checkstyle.
example
checkstyle {
toolVersion = '6.4'
configFile = file('google_checks.xml');
reportsDir = file("$project.buildDir/reports/checkstyle/")
}
I want to have English messages when compiling.
Following this post and this, I added the following to my build.gradle
compileJava {
options.compilerArgs << '-J-Duser.language=en'
options.fork = true
options.forkOptions.executable = 'javac'
}
But I get ([] is my translation, not official)
javac: 无效的标记[invalid flags]: -J-Duser.language=en
用法[usage]: javac <options> <source files>
-help 用于列出可能的选项[for possible options]
In cmd, a simple javac -J-Duser.language=en do gives me English messages.
My question:
What am I doing wrong?
How can I make gradle show the exact javac command used when compiling?
Instead of using -J, passing the flag to options.forkOptions.jvmArgs should work:
tasks.withType(JavaCompile) {
options.fork = true
options.forkOptions.jvmArgs += ["-Duser.language=en"]
}