Shell Annotation (Syntaxnet)

I downloaded and installed SyntaxNet after the official documentation on the Github syntax . following the documentation (annotating body), I tried to read the .conll file named wj.conll from SyntaxNet and write the results to wj-tagged.conll , but I could not. My questions:

  • Does SyntaxNet always read .conll files? (not .txt files?). I was a little embarrassed because I knew that SyntaxNet reads the .conll file for training and testing, but I am a little suspicious that I need to convert the .txt file to a .conll file in order to have my part in speech and dependency analysis.

  • How can I read SyntaxNet from files (I'm tired of all possible ways to explain in the GitHub documentation about SyntaxNet, and this did not work for me)

+5
source share
2 answers

Add these ad lines to "context.pbtxt" at the end of the file. Here, β€œinp” and β€œout” are text files present in the syntexnet root directory.

  input { name: 'inp_file' record_format: 'english-text' Part { file_pattern: 'inp' } } input { name: 'out_file' record_format: 'english-text' Part { file_pattern: 'out' } } 

Add sentences to the "inp" file for which you want to mark, and specify them in the shell the next time you start the syntax network using the --input and --output tags.

Just to help you a little more, I am inserting a shell example.

 bazel-bin/syntaxnet/parser_eval \ --input inp_file \ --output stdout-conll \ --model syntaxnet/models/parsey_mcparseface/tagger-params \ --task_context syntaxnet/models/parsey_mcparseface/context.pbtxt \ --hidden_layer_sizes 64 \ --arg_prefix brain_tagger \ --graph_builder structured \ --slim_model \ --batch_size 1024 | bazel-bin/syntaxnet/parser_eval \ --input stdout-conll \ --output out_file \ --hidden_layer_sizes 512,512 \ --arg_prefix brain_parser \ --graph_builder structured \ --task_context syntaxnet/models/parsey_mcparseface/context.pbtxt \ --model_path syntaxnet/models/parsey_mcparseface/parser-params \ --slim_model --batch_size 1024 

In the above script, the output (POS tagging) of the first shell command is used as input for the second shell command, where the two shell commands are separated by the "|"

+6
source

just a quick help if you want to save the demonstration result in a .txt file:

try echo "open file X with application Y" | ./demo.sh > output.txt echo "open file X with application Y" | ./demo.sh > output.txt it gives a suggestion tree to the current directory.

-1
source

All Articles