Skip to content
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

a lot of codes are broken in allennlp 2.0 #9

Open
xiaoouwang opened this issue May 16, 2021 · 0 comments
Open

a lot of codes are broken in allennlp 2.0 #9

xiaoouwang opened this issue May 16, 2021 · 0 comments

Comments

@xiaoouwang
Copy link

xiaoouwang commented May 16, 2021

I'm now reading the book and notice a lot of bugs related to allennlp2.0. Does the author consider upgrading the code to allennlp2.0 to make it comply more with the title real world nlp?

It's a pity because this book is I think the only book using allennlp to tackle a range of general nlp tasks and I like it very much.

Some examples:

In the sst_classifier.ipynb one can note:

vocab = Vocabulary.from_instances(train_dataset + dev_dataset,
                                  min_count={'tokens': 3})

gives

unsupported operand type(s) for +: 'generator' and 'generator'

(easily fixable using list(reader.read('train.txt')))

The following two lines

train_dataset.index_with(vocab)
dev_dataset.index_with(vocab)

give

'generator' object has no attribute 'index_with'

and also not specific to allen2.0,

predictor = SentenceClassifierPredictor(model, dataset_reader=reader)

gives

AttributeError: 'StanfordSentimentTreeBankDatasetReader' object has no attribute '_tokenizer'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant