Я пытаюсь запустить трейнер отношений, как указано по адресу URL http://nlp.stanford.edu/software/relationExtractor.shtml Однако он не может найти теггер, хотя я указал stanford-postagger.jar в пути к классам. Любые указатели в правильном направлении на этом были бы очень полезны.Stanford Отношения не работают
Я бегу на Windows, в командной строке, как указано ниже:
D: \ 01.Jars \ Jars_Stanford \ Стэнфорд-corenlp-полный 2015-04-20> Java -cp «Стэнфорд -ner .jar; stanford-corenlp-3.5.2.jar; stanford-postagger.jar « edu.stanford.nlp.ie.mach inereading.MachineReading -arguments SuperAnnuation.properties PERCENTAGE OF TRAIN: 1.0 Журнал читателей level установлен в SEVERE Добавление аннотатора pos Исключение в потоке «main» java.lang.RuntimeException: edu.stanford.nlp.io.Runti meIOException: Неустранимая ошибка при загрузке тега гер модель на edu.stanford.nlp.pipeline.AnnotatorFactories $ 4.Create (AnnotatorFactor ies.java:292) на edu.stanford.nlp.pipeline.AnnotatorPool.get (AnnotatorPool.java:85) в edu.stanford .nlp.pipeline.StanfordCoreNLP.construct (StanfordCoreNLP.j AVA: 289) в edu.stanford.nlp.pipeline.StanfordCoreNLP (StanfordCoreNLP.java : 126). в edu.stanford.nlp.ie.machinereading.MachineReading .makeMachineReading ( MachineReading.java:228) на edu.stanford.nlp.ie.machinereading.MachineReading.main (MachineReading .java: 106), вызванные: edu.stanford.nlp.io.RuntimeIOException: неустранимая ошибка при loa ding модель тегов на edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit (MaxentTa gger.java:770) в edu.stanford.nlp.tagger.maxent.MaxentTagger. (MaxentTagger.java: 298) на образование. stanford.nlp.tagger.maxent.MaxentTagger (MaxentTagger.java: 263). на edu.stanford.nlp.pipeline.POSTaggerAnnotator.loadModel (POSTaggerAnnot ator.java:97) на edu.stanford.nlp.pipeline. POSTaggerAnnotator. (POSTaggerAnnotato r.java:77) на edu.stanford.nlp.pipeline.AnnotatorImplementations.posTagger (Annotato rImplementations.java:59) в edu.stanford.nlp.pipeline.AnnotatorFactories $ 4.Create (AnnotatorFactor ies.java:290) ... 5 more Причиненный: java.io.IOException: невозможно решить «edu/stanford/nlp/models/pos-t agger/english-left3words/english-left3words-distsim. Таггер»или как путь класса, имя файла или URL в edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSys TEM (IOUtils.java:481) в edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit (MaxentTa gger.java:765) ... 11 более
И файл Пенсионное имущество, используемое приводится ниже. Это файл свойство по умолчанию предоставляется на сайте:
#Below are some basic options. See edu.stanford.nlp.ie.machinereading.MachineReadingProperties class for more options.
# Pipeline options
annotators = pos, lemma, parse
parse.maxlen = 100
# MachineReading properties. You need one class to read the dataset into correct format. See edu.stanford.nlp.ie.machinereading.domains.ace.AceReader for another example.
datasetReaderClass = edu.stanford.nlp.ie.machinereading.domains.roth.RothCONLL04Reader
#Data directory for training. The datasetReaderClass reads data from this path and makes corresponding sentences and annotations.
trainPath = /u/nlp/data/RothCONLL04/conll04.corp
#Whether to crossValidate, that is evaluate, or just train.
crossValidate = false
kfold = 10
#Change this to true if you want to use CoreNLP pipeline generated NER tags. The default model generated with the relation extractor release uses the CoreNLP pipeline provided tags (option set to true).
trainUsePipelineNER=false
# where to save training sentences. uses the file if it exists, otherwise creates it.
serializedTrainingSentencesPath = tmp/roth_sentences.ser
serializedEntityExtractorPath = tmp/roth_entity_model.ser
# where to store the output of the extractor (sentence objects with relations generated by the model). This is what you will use as the model when using 'relation' annotator in the CoreNLP pipeline.
serializedRelationExtractorPath = tmp/roth_relation_model_pipeline.ser
# uncomment to load a serialized model instead of retraining
# loadModel = true
#relationResultsPrinters = edu.stanford.nlp.ie.machinereading.RelationExtractorResultsPrinter,edu.stanford.nlp.ie.machinereading.domains.roth.RothResultsByRelation. For printing output of the model.
relationResultsPrinters = edu.stanford.nlp.ie.machinereading.RelationExtractorResultsPrinter
#In this domain, this is trivial since all the entities are given (or set using CoreNLP NER tagger).
entityClassifier = edu.stanford.nlp.ie.machinereading.domains.roth.RothEntityExtractor
extractRelations = true
extractEvents = false
#We are setting the entities beforehand so the model does not learn how to extract entities etc.
extractEntities = false
#Opposite of crossValidate.
trainOnly=true
# The set chosen by feature selection using RothCONLL04:
relationFeatures = arg_words,arg_type,dependency_path_lowlevel,dependency_path_words,surface_path_POS,entities_between_args,full_tree_path
# The above features plus the features used in Bjorne BioNLP09:
# relationFeatures = arg_words,arg_type,dependency_path_lowlevel,dependency_path_words,surface_path_POS,entities_between_args,full_tree_path,dependency_path_POS_unigrams,dependency_path_word_n_grams,dependency_path_POS_n_grams,dependency_path_edge_lowlevel_n_grams,dependency_path_edge-node-edge-grams_lowlevel,dependency_path_node-edge-node-grams_lowlevel,dependency_path_directed_bigrams,dependency_path_edge_unigrams,same_head,entity_counts
Благодарим за отзыв.Я работаю с полным набором кодов кода и модели, но все еще получаю ошибку. Не уверен, что я делаю неправильно. – Bonson
Спасибо @Gabor Angeli за комментарий. Я изменил команду, и теперь она работает. 'java -cp stanford-corenlp-3.5.2.jar; stanford-corenlp-3.5.2-models.jar; C: \ jars \ jars_stanford \ stanford-postagger-full-2015-04-20 \ stanford-postagger-3.5 .2.jar; C: \ баночки \ jars_stanford \ Стэнфорд-postagger-полной 2015-04-20 \ модели \ английский-left3words-distsim.tagger; Редактировать – Bonson