sighsmile / conlleval Goto Github PK
View Code? Open in Web Editor NEWconlleval in Python (script for chunking/NER evaluation)
conlleval in Python (script for chunking/NER evaluation)
请问一下您,true_tags和pred_tags的输入是否类似[[,,,,,,,,,],[,,,,,,,],[,,,,,,,,,,]],即二维嵌套list类型?
#这样会报错
from conlleval import evaluate
true_tags =[ ['O', 'B-Part', 'I-Part'],[ 'O', 'O', 'O']]
pred_tags = [ ['O', 'B-Part', 'I-Part'],[ 'O', 'O', 'O']]
evaluate(true_tags,pred_tags)
#这样不报错
from conlleval import evaluate
true_tags =[ 'O', 'B-Part', 'I-Part', 'O', 'O', 'O']
pred_tags = [ 'O', 'B-Part', 'I-Part', 'O', 'O', 'O']
evaluate(true_tags,pred_tags)
这是否意味着每次只能对一个序列进行性能评估?
I have ran the script on the following data:
(978) B-Phone I-Phone
934-3623 I-Phone I-Phone
In the IOB2 mode, every entity tag should starts with B. So the precision of the above should be 0. But the script you provided shows a result of 100% precision. However, I tried the original perl version conlleval script, same result.
Getting this error when using arbitrary tags like , , etc.
count_chunks(true_seqs, pred_seqs)
129
130 _, true_type = split_tag(true_tag)
--> 131 _, pred_type = split_tag(pred_tag)
132
133 if correct_chunk is not None:
ValueError: not enough values to unpack (expected 2, got 1)
I believe this happens if tags don't have a "-" in them or aren't an "O".
My output.txt file is the following format:
Sao NC B-LOC B-LOC
Paulo VMI I-LOC I-LOC
( Fpa O O
Brasil NC B-LOC B-LOC
) Fpt O O
, Fc O O
23 Z O O
may NC O O
( Fpa O O
EFECOM NP B-ORG B-ORG
) Fpt O O
. Fp O O
Which should be okay according to the conll format. But after running the conll.py I am getting this error:
Do you have any idea why? @sighsmile
Thanks in advance!
my output file is like:
a B-LOC B-LOC
b I-LOC E-LOC
c E-LOC S-LOC
and the result is different,
for conlleval.py
processed 3 tokens with 1 phrases; found: 2 phrases; correct: 0.
accuracy: 33.33%; (non-O)
accuracy: 33.33%; precision: 0.00%; recall: 0.00%; FB1: 0.00
LOC: precision: 0.00%; recall: 0.00%; FB1: 0.00 2
for connlleval_perl.py
processed 3 tokens with 1 phrases; found: 1 phrases; correct: 1.
accuracy: 33.33%; precision: 100.00%; recall: 100.00%; FB1: 100.00
LOC: precision: 100.00%; recall: 100.00%; FB1: 100.00 1
which one is reliable?
IOB2 is supported as input as you told in the readme, but the evaluation metrics is not in iob2 way. It's in iob1 way. So, you can either provide option for people to choose evaluation scheme for iob1 or iob2, or you can stop the support of iob2 format input.
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.