Comments (3)
Same question here.
Also, when measuring F1 score, if a slot is n token, the current measurement will calculate it n times.
from massive.
Hi @yichaopku (and @ihungalexhsu ), this is indeed a (major) bug. Thank you very much for finding this.
Please see the PR here: #14
from massive.
Hi @jgmf-amazon, thanks for your reply. However, the current evaluation code contains some issue:
def convert_to_bio(seq_tags, outside='Other', labels_merge=None):
"""
Converts a sequence of tags into BIO format. EX:
['city', 'city', 'Other', 'country', -100, 'Other']
to
['B-city', 'I-city', 'O', 'B-country', 'I-country', 'O']
where outside = 'Other' and labels_merge = [-100]
:param seq_tags: the sequence of tags that should be converted
:type seq_tags: list
:param outside: The label(s) to put outside (ignore). Default: 'Other'
:type outside: str or list
:param labels_merge: The labels to merge leftward (i.e. for tokenized inputs)
:type labels_merge: str or list
:return: a BIO-tagged sequence
:rtype: list
"""
seq_tags = [str(x) for x in seq_tags]
outside = [outside] if type(outside) != list else outside
outside = [str(x) for x in outside]
if labels_merge:
labels_merge = [labels_merge] if type(labels_merge) != list else labels_merge
labels_merge = [str(x) for x in labels_merge]
else:
labels_merge = []
bio_tagged = []
prev_tag = None
for tag in seq_tags:
if tag in outside:
bio_tagged.append('O')
prev_tag = tag
continue
if tag != prev_tag and tag not in labels_merge:
bio_tagged.append('B-' + tag)
prev_tag = tag
continue
if tag == prev_tag or tag in labels_merge:
if prev_tag in outside:
bio_tagged.append('O')
else:
bio_tagged.append('I-' + prev_tag)
return bio_tagged
The current code will meet a bug when:
prev_tag is None and tag is -100.
This will not happen if model is properly trained, but when train the model at the beginning stage, the model might output this silly combination.
Maybe a potential solution is not initialized prev_tag with None, but using 'O'?
from massive.
Related Issues (20)
- infer a statement HOT 3
- GPU memory usage keeps growing when Performing Inference on the Test Set. HOT 4
- Issue for converting bio sequence HOT 3
- TypeError when training a xlmr zero-shot encoder HOT 3
- About the competition rules of zero-shot task HOT 1
- Can anyone reproduce the baseline results reported in the paper with the current version of codes? HOT 3
- Does Label Truncation Influence the Results? HOT 2
- use fp16 to train the t2t mT5 model HOT 6
- Cannot reproduce xlmr-base zero-shot results HOT 10
- About the official evaluation script HOT 2
- Number of parameters limit HOT 2
- Error while creating predictions on heldout dataset HOT 4
- Will the rule "dev splits of the MASSIVE dataset may not be used for model training" makes the competition unfair for individual contestants HOT 1
- Unable to prepare data HOT 2
- Error in create_hf_dataset.py while using existing intent and slot mappings HOT 2
- Training duration for Zero Shot Training?
- Where to find number-to-intent and number-to-slot mappings?
- Preparing data HOT 3
- Add export python path in the readme? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from massive.