0
String prop = "austen.prop";
Properties props = StringUtils.propFileToProperties(prop);
String to = props.getProperty("serializeTo");
props.setProperty("serializeTo", "C:\\ner-jxy-model.ser.gz");
SeqClassifierFlags flags = new SeqClassifierFlags(props);
CRFClassifier<CoreLabel> crf = new CRFClassifier<CoreLabel>(flags);
crf.train();
,這是我austen.prop我訓練斯坦福NER程序,但沒有得到模型文件
#location of the training file
trainFile = train.tsv
#location where you would like to save (serialize to) your
#classifier; adding .gz at the end automatically gzips the file,
#making it faster and smaller
serializeTo = ner-model.ser.gz
#structure of your training file; this tells the classifier
#that the word is in column 0 and the correct answer is in
#column 1
map = word=0,answer=1
#these are the features we'd like to train with
#some are discussed below, the rest can be
#understood by looking at NERFeatureFactory
useClassFeature=true
useWord=true
useNGrams=true
#no ngrams will be included that do not contain either the
#beginning or end of the word
noMidNGrams=true
useDisjunctive=true
maxNGramLeng=6
usePrev=true
useNext=true
useSequences=true
usePrevSequences=true
maxLeft=1
#the next 4 deal with word shape features
useTypeSeqs=true
useTypeSeqs2=true
useTypeySequences=true
wordShape=chris2useLC
我訓練斯坦福NER程序,但沒有得到模型文件NER-model.ser。 GZ。
但它工作時,我直接使用crf分類。
我恰好具有我同樣的問題。你發現了什麼錯?我無法在文檔中找到任何線索。 – cheseaux 2014-11-12 14:49:04
在你的prop文件中,我可以看到你想要序列化到某個文件,然後以編程方式給它另外一個名字...爲什麼是這樣? – MiNdFrEaK 2016-01-22 04:57:49