lixin4ever / BERT-E2E-ABSA

[EMNLP 2019 Workshop] Exploiting BERT for End-to-End Aspect-based Sentiment Analysis
https://arxiv.org/abs/1910.00883
Apache License 2.0
396 stars 89 forks source link

why you return empty list when the tagging_schema is OT? #14

Closed DaniaALkhadraa closed 4 years ago

DaniaALkhadraa commented 4 years ago

def get_labels(self, tagging_schema):

    if tagging_schema == 'OT':
        return []
    elif tagging_schema == 'BIO':
        return ['O', 'EQ', 'B-POS', 'I-POS', 'B-NEG', 'I-NEG', 'B-NEU', 'I-NEU']
    elif tagging_schema == 'BIEOS':
        return ['O', 'EQ', 'B-POS', 'I-POS', 'E-POS', 'S-POS',
        'B-NEG', 'I-NEG', 'E-NEG', 'S-NEG',
        'B-NEU', 'I-NEU', 'E-NEU', 'S-NEU']
    else:
        raise Exception("Invalid tagging schema %s..." % tagging_schema)
lixin4ever commented 4 years ago

Thank you for your attention.

I haven't tried to set the tagging_schema as OT and the empty list here (i.e., line 118) is actually a placeholder.

If you still want to run the code with OT tagging schema, you can change this line to:

return ['O', 'EQ', 'T-POS', 'T-NEG', 'T-NEU']

BTW, after changing the value of tagging_schema, you should remove the cached data files so that the newly built ones follow the updated tagging schema.