使用 Syntaxnet 注释语料库

Annotating a corpus using Syntaxnet

我正在尝试使用 Syntaxnet 注释语料库。我在 /models/syntaxnet/syntaxnet/models/parsey_mcparseface/context.pbtxt 文件的末尾添加了以下行:

input {
name: 'input_file'
record_format: 'english-text'
Part {
file_pattern: '/home/melvyn/text.txt'
}
}
output {
name: 'output_file'
record_format: 'english-text'
Part {
file_pattern: '/home/melvyn/text-tagged.txt'
}
}

当我运行命令时:

./demo.sh --input=input_file --output=output_file

我得到:

./demo.sh: line 31: bazel-bin/syntaxnet/parser_eval: No such file or directory
./demo.sh: line 43: bazel-bin/syntaxnet/parser_eval: No such file or directory
./demo.sh: line 55: bazel-bin/syntaxnet/conll2tree: No such file or directory

根据 ## 此处 ## 给出的答案,我更改了我的 demo.sh 文件,现在我收到一些错误消息:

[libprotobuf ERROR external/tf/google/protobuf/src/google/protobuf/text_format.cc:291] Error parsing text-format syntaxnet.TaskSpec: 200:8: Message type "syntaxnet.TaskOutput" has no field named "Part".
E external/tf/tensorflow/core/framework/op_segment.cc:53] Create kernel failed: Invalid argument: Could not parse task context at syntaxnet/models/parsey_mcparseface/context.pbtxt
E external/tf/tensorflow/core/common_runtime/executor.cc:333] Executor failed to create kernel. Invalid argument: Could not parse task context at syntaxnet/models/parsey_mcparseface/context.pbtxt
[[Node: DocumentSource = DocumentSourcebatch_size=32, corpus_name="stdin-conll", task_context="syntaxnet/models/parsey_mcparseface/context.pbtxt", _device="/job:localhost/replica:0/task:0/cpu:0"]]

可能的解决方案是什么?

虽然不确定,但我认为你不是运行根目录下的shell脚本。请按照

中提到的说明尝试 运行

希望对您有所帮助。