You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have passed a train data file and empty files for dev and the test data set I face the same problem on my custom data set.
link for data set
from flair.data import Corpus
from flair.datasets import ColumnCorpus
# define columns
columns = {0: 'text', 1: 'ner'}
# this is the folder in which train, test and dev files reside
# init a corpus using column format, data folder and the names of the train, dev and test files
corpus: Corpus = ColumnCorpus('',columns,
train_file='train.txt',
dev_file='test.txt',
test_file='test.txt')
from flair.data import Corpus
from flair.embeddings import TokenEmbeddings, WordEmbeddings, StackedEmbeddings, PooledFlairEmbeddings
from typing import List
# 1. get the corpus
# 2. what tag do we want to predict?
tag_type = 'ner'
# 3. make the tag dictionary from the corpus
tag_dictionary = corpus.make_tag_dictionary(tag_type=tag_type)
# initialize embeddings
embedding_types: List[TokenEmbeddings] = [
# GloVe embeddings
WordEmbeddings('glove'),
# contextual string embeddings, forward
PooledFlairEmbeddings('news-forward', pooling='min'),
# contextual string embeddings, backward
PooledFlairEmbeddings('news-backward', pooling='min'),
]
embeddings: StackedEmbeddings = StackedEmbeddings(embeddings=embedding_types)
# initialize sequence tagger
from flair.models import SequenceTagger
tagger: SequenceTagger = SequenceTagger(hidden_size=256,
embeddings=embeddings,
tag_dictionary=tag_dictionary,
tag_type=tag_type)
# initialize trainer
from flair.trainers import ModelTrainer
trainer: ModelTrainer = ModelTrainer(tagger,corpus)
trainer.train('resources/taggers/example-ner',train_with_dev=True,max_epochs=150)
Expected behavior
IndexError: string index out of range
Environment (please complete the following information):
OS [Linux 18.04 ]:
Version [flair-0.4.3]:
cuda 10 and gpu version
OS [windows10 ]:
Version [flair-0.4.3]:
cpu
The text was updated successfully, but these errors were encountered:
Describe the bug
I have passed a train data file and empty files for dev and the test data set I face the same problem on my custom data set.
link for data set
https://drive.google.com/open?id=1ZiWTVuvcm5r0kRM50P8xV2trbKyjVU7-
To Reproduce
Expected behavior
IndexError: string index out of range
Environment (please complete the following information):
OS [windows10 ]:
The text was updated successfully, but these errors were encountered: