2016-12-29 26 views
0

CRFモデルを作成しました。私のデータセットは24のクラスを持ち、この時点では私は初めですので、私のトレーニングデータはわずか1200トークン/コーパスです。私はモデルを訓練している。私の訓練データでは、住所、写真、州、国などの複数のトークンを使用しています。単数ではなく複数で訓練されたCRFモデル

今、このモデルに複数のトークンを文形式で与えると、写真、州などのような単数形で私の文章を入力してください、そして、それにタグを割り当てません。

このcrfの動作は非常に奇妙に見えています。私はNER Feature Factoryを探索し、いくつかの補題を使用しましたが、それもうまくいきませんでした。モデル作成のために私のausten.propを共有しています。

# location of the training file 
trainFile = training_data_for_ner.txt 
# location where you would like to save (serialize) your 
# classifier; adding .gz at the end automatically gzips the file, 
# making it smaller, and faster to load 
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,pos=2,lemma=3 

# This specifies the order of the CRF: order 1 means that features 
# apply at most to a class pair of previous class and current class 
# or current class and next class. 
maxLeft=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 
# word character ngrams will be included up to length 6 as prefixes 
# and suffixes only 
useNGrams=true 
noMidNGrams=true 
maxNGramLeng=6 
usePrev=true 
useNext=true 
useDisjunctive=true 
useSequences=true 
usePrevSequences=true 
# the last 4 properties deal with word shape features 
useTypeSeqs=true 
useTypeSeqs2=true 
useTypeySequences=true 
wordShape=chris2useLC 
# newly added features. 
useLemmas=true 
usePrevNextLemmas=true 
useLemmaAsWord=true 
useTags=true 

最後の4つの機能は、NER Feature Factoryを読んで追加されました。誰かが私にこの問題を解決するのを助けることができるなら、私はあなたに感謝します。

答えて

0

あなたは、トーントークンでそれを再テストする必要があります。たとえば、https://github.com/stanfordnlp/CoreNLP/blob/master/src/edu/stanford/nlp/process/Stemmer.javamainメソッド)を参照してください。

+0

また、補助音とステムドトークンの両方を同時に保持できますか? crfモデルの形成には大丈夫でしょうか? –

+0

あなたのデータセットによって異なります。私はあなたがそれをしてはならないと思います。クロスバリデーションで常に品質(F1スコアなど)を確認し、最適なオプションを選択することができます。 – dveim

+0

この特定の列にスムーズトークンが含まれていることをマップにどのように指定しますか?たとえば、トレーニングファイルの5番目の列にはトークントークンが含まれています。次に、austen.propでマップを書き込む必要があります。 map = ...... stem = 4またはstemmer = 4? –

関連する問題