fanhuaandluomu / bilstm_cnn_crf_cws Goto Github PK
View Code? Open in Web Editor NEWBiLstm+CNN+CRF 法律文档(合同类案件)领域分词(100篇标注样本)
BiLstm+CNN+CRF 法律文档(合同类案件)领域分词(100篇标注样本)
InvalidArgumentError (see above for traceback): Matrix size-incompatible: In[0]: [3168,1], In[1]: [4,4]
[[Node: loss/crf_1_loss/MatMul_1 = MatMul[T=DT_FLOAT, transpose_a=false, transpose_b=false, _device="/job:localhost/replica:0/task:0/cpu:0"](loss/crf_1_loss/Reshape_3, loss/crf_1_loss/Reshape_4)]]
请问CRF层是出了什么问题吗? 感谢
2018-04-17 14:11:48.703574: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
WARNING:tensorflow:From /usr/local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:1188: calling reduce_sum (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
bilstm_cnn_crf.py:59: UserWarning: Update your Conv1D
call to the Keras 2 API: Conv1D(padding="valid", kernel_size=5, filters=50)
conv=Conv1D(nb_filter=50,filter_length=2*half_window_size+1,padding='valid')(padding_layer)
WARNING:tensorflow:From /usr/local/lib/python3.5/site-packages/tensorflow/python/util/deprecation.py:497: calling conv1d (from tensorflow.python.ops.nn_ops) with data_format=NHWC is deprecated and will be removed in a future version.
Instructions for updating:
NHWC
for data_format is deprecated, use NWC
instead
bilstm_cnn_crf.py:64: UserWarning: The merge
function is deprecated and will be removed after 08/2017. Use instead layers from keras.layers.merge
, e.g. add
, concatenate
, etc.
rnn_cnn_merge=merge([bilstm_d,dense_conv],mode='concat',concat_axis=2)
/usr/local/lib/python3.5/site-packages/keras/legacy/layers.py:458: UserWarning: The Merge
layer is deprecated and will be removed after 08/2017. Use instead layers from keras.layers.merge
, e.g. add
, concatenate
, etc.
name=name)
WARNING:tensorflow:From /usr/local/lib/python3.5/site-packages/keras/backend/tensorflow_backend.py:1171: calling reduce_min (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
bilstm_cnn_crf.py:72: UserWarning: Update your Model
call to the Keras 2 API: Model(inputs=[<tf.Tenso..., outputs=[<tf.Tenso...)
model = Model(output=[crf_output], input=[word_input])
Traceback (most recent call last):
File "bilstm_cnn_crf.py", line 458, in
main()
File "bilstm_cnn_crf.py", line 436, in main
process_train(corpus_path,nb_epoch,base_model_weight)
File "bilstm_cnn_crf.py", line 248, in process_train
model=Bilstm_CNN_Crf(max_len,len(lexicon),len(label_2_index),embedding_weights)
File "bilstm_cnn_crf.py", line 74, in Bilstm_CNN_Crf
model.compile(loss=crf.loss_function,optimizer='adam',metrics=[crf.accuracy])
File "/usr/local/lib/python3.5/site-packages/keras/engine/training.py", line 850, in compile
sample_weight, mask)
File "/usr/local/lib/python3.5/site-packages/keras/engine/training.py", line 450, in weighted
score_array = fn(y_true, y_pred)
File "/usr/local/lib/python3.5/site-packages/keras_contrib/layers/crf.py", line 287, in loss
assert self._inbound_nodes, 'CRF has not connected to any layer.'
mldl@mldlUB1604:/ub16_prj/BiLstm_CNN_CRF_CWS$ python3 embedding_model.py/ub16_prj/BiLstm_CNN_CRF_CWS$
Using TensorFlow backend.
Traceback (most recent call last):
File "embedding_model.py", line 20, in
sentences=MySentences([corpus_path+os.sep+fname for fname in os.listdir(corpus_path)])
FileNotFoundError: [Errno 2] No such file or directory: 'corpus'
mldl@mldlUB1604:
做序列标注 用的OBIE 为什么会出现I O的这种情况 数据里面没有这种情况 这个CRF的实现确定没问题吗?
您好,您这个实验对应论文题目叫什么,想拜读一下,谢谢
Traceback (most recent call last):
File "E:/IDEA/IDEA/python/BiLstm_CNN_CRF_CWS-master/BiLstm_CNN_CRF_CWS-master/wechat_search.py", line 7, in
from fenci_server import word_seg
File "E:\IDEA\IDEA\python\BiLstm_CNN_CRF_CWS-master\BiLstm_CNN_CRF_CWS-master\fenci_server.py", line 391, in
from lss_fenci_api import samme_cws
ImportError: No module named 'lss_fenci_api'
请问Bilstm_CNN_Crf()中LSTM的输出64是如何确定的?
LSTM(64, return_sequences=True)
ub16hp@UB16HP:/ub16_prj/BiLstm_CNN_CRF_CWS/simple_bilstm_model$ python bilstm__cnn_crf.py/ub16_prj/BiLstm_CNN_CRF_CWS/simple_bilstm_model$
Using TensorFlow backend.
Traceback (most recent call last):
File "bilstm__cnn_crf.py", line 27, in
from keras_contrib.layers import CRF
File "/usr/local/lib/python2.7/dist-packages/keras_contrib/init.py", line 4, in
from . import layers
File "/usr/local/lib/python2.7/dist-packages/keras_contrib/layers/init.py", line 3, in
from .convolutional import *
File "/usr/local/lib/python2.7/dist-packages/keras_contrib/layers/convolutional.py", line 15, in
from keras.backend.common import normalize_data_format
ImportError: cannot import name normalize_data_format
ub16hp@UB16HP:
同学,你好。关于embedding_model.py代码我有个小疑问。代码中用genism做中文词向量的。但是你代码好像将语料库中本来已空格分好的词又replace了,最终输出的是字的向量。不知道是不是我理解有误。
for dirname in self.dirname_list:
for fname in os.listdir(dirname):
for line in codecs.open(dirname+os.sep+fname,'r','utf-8'):
pieces=line.strip().replace(' ','')
words=[w for w in pieces]
yield words
pieces这块你把空格给replace了。
做序列标注 用的OBIE 为什么会出现I O的这种情况 数据里面没有这种情况 这个CRF的实现确定没问题吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.