コード例 #1
0
def main():
    Xtrain, Ytrain, Xtest, Ytest, word2idx, tag2idx = get_data(split_sequences=True)
    V = len(word2idx)
    rnn = RNN(10, [10], V)
    rnn.fit(Xtrain, Ytrain, epochs=70)
    print "train f1 score:", rnn.f1_score(Xtrain, Ytrain)
    print "test f1 score:", rnn.f1_score(Xtest, Ytest)
コード例 #2
0
ファイル: ner_rnn.py プロジェクト: jerryxyx/Python
def main():
    Xtrain, Ytrain, Xtest, Ytest, word2idx, tag2idx = get_data(
        split_sequences=True)
    V = len(word2idx)
    rnn = RNN(10, [10], V)
    rnn.fit(Xtrain, Ytrain, epochs=70)
    print "train f1 score:", rnn.f1_score(Xtrain, Ytrain)
    print "test f1 score:", rnn.f1_score(Xtest, Ytest)
コード例 #3
0
def main():
    Xtrain, Ytrain, Xtest, Ytest, word2idx, tag2idx = get_data(split_sequences=True)
    V = len(word2idx)