-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify data fetchers #65
Comments
alanakbik
pushed a commit
that referenced
this issue
Aug 14, 2018
alanakbik
pushed a commit
that referenced
this issue
Aug 14, 2018
alanakbik
pushed a commit
that referenced
this issue
Aug 14, 2018
tabergma
added a commit
that referenced
this issue
Aug 14, 2018
GH-65: refactored to generic column format and string enums
Data fetchers now simplified. You can read any CoNLL column formatted file by passing a dict that specifies what column is what field. For instance: from flair.data_fetcher import NLPTaskDataFetcher
sentences = NLPTaskDataFetcher.read_column_data('/path/to/conll03/data', column_name_map={0: 'text', 3: 'ner'})
for sentence in sentences:
print(sentence.to_tagged_string()) Will read a CoNLL-03 formatted file and map the first column (index 0) to the lexical value of each word (i.e. the token text) and column index 3 as the NER tag. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a lot of redundant code in the data fetcher helper routines. Simplify by creating a generic 'CoNLL-column' data reader that can be passed the column definition, so it is applicable to CoNLL03, CoNLL2000 and any other sequence labeling data that is formatted in a similar column style.
The text was updated successfully, but these errors were encountered: