Coder Social home page Coder Social logo

ner_demo's Issues

CRF层出错

你好,这是什么原因造成的呢?
Traceback (most recent call last):
File "D:/研究生/NER_DEMO-master/NER_DEMO-master/train.py", line 108, in
info_list = train_sample(train_model='BERTBILSTMCRF', epochs=15, log=log)
File "D:/研究生/NER_DEMO-master/NER_DEMO-master/train.py", line 52, in train_sample
model = model_class.creat_model()
File "D:\研究生\NER_DEMO-master\NER_DEMO-master\Model\BERT_BILSTM_CRF.py", line 51, in creat_model
x = self.crf(x)
File "D:\Application\python3.6\lib\site-packages\keras\engine\base_layer.py", line 443, in call
previous_mask = _collect_previous_mask(inputs)
File "D:\Application\python3.6\lib\site-packages\keras\engine\base_layer.py", line 1311, in _collect_previous_mask
mask = node.output_masks[tensor_index]
AttributeError: 'Node' object has no attribute 'output_masks'

用自己的数据集和标签怎么改

我按照data2的格式修改了我的数据集 并且在vocab.py里修改了实体类别 但我试验抛出的结果显示正确率没问题 但召回率和F值只有0.0几 请问下问题出在那里 歇息大佬

bug: in f1score, recall metricts

I am so sorry to found that your f1score and recall are wrong.
yours:
f1score = f1_score(pre, test_label, average='macro')
recall = recall_score(pre, test_label, average='macro')

but:
def f1_score(y_true, y_pred, *, labels=None, pos_label=1, average='binary',
sample_weight=None, zero_division="warn")
def recall_score(y_true, y_pred, *, labels=None, pos_label=1, average='binary',
sample_weight=None, zero_division="warn")

the position of y_true and y_pred is reversed.
it is cost a long time for finding this difference when i use my DIY metricts.

为什么用BERTBILSTMCRF模型时报错

Traceback (most recent call last):
File "train.py", line 101, in
info_list = train_sample(train_model=model, epochs=10, log=log)
File "train.py", line 51, in train_sample
model = model_class.creat_model()
File "/root/NER_DEMO-master/Model/BERT_BILSTM_CRF.py", line 39, in creat_model
trainable=True)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/loader.py", line 169, in load_trained_model_from_checkpoint
**kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/loader.py", line 58, in build_model_from_config
**kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/bert.py", line 91, in get_model
dropout_rate=dropout_rate,
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/keras_bert/layers/embedding.py", line 56, in get_embedding
)(embed_layer)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 663, in call
inputs, outputs, args, kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1708, in set_connectivity_metadata
input_tensors=inputs, output_tensors=outputs, arguments=kwargs)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1796, in _add_inbound_node
input_tensors)
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 515, in map_structure
structure[0], [func(*x) for x in entries],
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/util/nest.py", line 515, in
structure[0], [func(*x) for x in entries],
File "/root/miniconda3/envs/tf/lib/python3.6/site-packages/tensorflow/python/keras/engine/base_layer.py", line 1795, in
inbound_layers = nest.map_structure(lambda t: t._keras_history.layer,
AttributeError: 'tuple' object has no attribute 'layer'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.