We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
when trying to understand bert_text_classification.ipynb
this part of notebook
from allennlp.data.token_indexers import PretrainedBertIndexer
token_indexer = PretrainedBertIndexer( pretrained_model="bert-base-uncased", max_pieces=config.max_seq_len, do_lowercase=True, )
def tokenizer(s: str): return token_indexer.wordpiece_tokenizer(s)[:config.max_seq_len - 2]
gives this error
ImportError Traceback (most recent call last) in () ----> 1 from allennlp.data.token_indexers import PretrainedBertIndexer 2 3 token_indexer = PretrainedBertIndexer( 4 pretrained_model="bert-base-uncased", 5 max_pieces=config.max_seq_len,
ImportError: cannot import name 'PretrainedBertIndexer'
NOTE: If your import is failing due to a missing package, you can manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the "Open Examples" button below.
allennlp version used is 1.0.0
seems version differ , I could not find the solution what should I do?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
when trying to understand
bert_text_classification.ipynb
this part of notebook
from allennlp.data.token_indexers import PretrainedBertIndexer
token_indexer = PretrainedBertIndexer(
pretrained_model="bert-base-uncased",
max_pieces=config.max_seq_len,
do_lowercase=True,
)
apparently we need to truncate the sequence here, which is a stupid design decision
def tokenizer(s: str):
return token_indexer.wordpiece_tokenizer(s)[:config.max_seq_len - 2]
gives this error
ImportError Traceback (most recent call last)
in ()
----> 1 from allennlp.data.token_indexers import PretrainedBertIndexer
2
3 token_indexer = PretrainedBertIndexer(
4 pretrained_model="bert-base-uncased",
5 max_pieces=config.max_seq_len,
ImportError: cannot import name 'PretrainedBertIndexer'
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
allennlp version used is 1.0.0
seems version differ , I could not find the solution
what should I do?
The text was updated successfully, but these errors were encountered: