Questions tagged [allennlp]
An open-source NLP research library, built on PyTorch
206
questions
0
votes
0
answers
12
views
AllenNLP v1.5.0 No module named 'allennlp.data.tokenizers.word_splitter'
I got an import error as :
from allennlp.data.tokenizers.word_splitter import SpacyWordSplitter
ModuleNotFoundError: No module named'allennlp.data.tokenizers.word_splitter'
Also allennlp.data....
0
votes
0
answers
37
views
How to use multiple GPUs for training?
I am simply trying to understand how to format a config file to allow multiple GPUs/distributed training to take place via the "train" command.
The only clear tutorial out there is seemingly ...
0
votes
0
answers
20
views
How can I make the openIE input file format
I want to do OpenIE extraction and make the input file, but I cannot figure out the way to convert the raw sentence. My example is below:
Example(input raw sentence):
32.7 % of all households were ...
0
votes
1
answer
23
views
How to convert a list of words into multiple sentences in python
Eg:
Input:
Name: ['FirstName','LastName','FirstNameLastName']
Customer Account Number: ['Customer', 'Account', 'Number', 'Customer Account', 'Customer Number', 'Customer Account Number']
output:
...
0
votes
0
answers
13
views
How to change the train set during training with AllenNLP
I'm new to AllenNLP. I was considering providing different training set at each epoch, but use the same model. If I use a configuration file such as jsonnet, the training set must not change during ...
2
votes
1
answer
54
views
How to install jsonnet on conda
I am installing allennlp and it has quite a lot of dependencies. Everything is installing fine but the installalation of Jsonnet is failing.
I tried installing jsonnet using
pip install jsonnet ...
0
votes
0
answers
12
views
Training SRL using BERT on german language with AllenNLP
I am trying to train a SRL model for German text by translating Ontonotes dataset and propagating the labels from English sentences to German sentences. When i train the model with this dataset, as ...
0
votes
0
answers
9
views
Questions about start training from checkpoint using --recover in allennlp
For some reason, during training:
I want to store the checkpoint after every epoch and start training the next epoch from the stored checkpoint.
I want the training state to remain continued among ...
0
votes
1
answer
64
views
Load custom package model to get model vocabulary in AllenNLP python interface
I'm trying to get the vocabulary from some publicly-available pre-trained models (that aren't mine) using the python interface of AllenNLP, using self.vocab. However, I'm running into problems trying ...
0
votes
1
answer
37
views
Change tokenizer when loading Dependency Parsing model from AllenNLP
I am using a pretrained dependency parsing model from AllenNLP, namely this one.
I have the sentence How do I find work-life balance?, and when extracting the dependency graph, the tokenizer used by ...
-2
votes
1
answer
48
views
CUDA memory issue with allennlp coreference resolution API
Hi I have some CUDA memory issue even though I am using multiple GPUs. I am calling coreference resolution API on long document (aorund 2000words). It seems that the memory is not paralleled. How can ...
0
votes
1
answer
55
views
Equivalent of allennlp.commands.elmo in Allennlp v0.8.4 for version 2.10.0
I'm using a Python library as a dependency of my app, which imports Allennlp v0.8.4. The library uses ElmoEmbedder class for getting tokenised word embeddings with its batch_to_embeddings() function ...
0
votes
1
answer
46
views
Allennlp Does not generate model.tar.gz after training
I am training a coreference resolution model with Alennlp. However after I execute the command train_data_path=<train path> validation_data_path=<dev path> test_data_path=<testpath> ...
1
vote
2
answers
132
views
Is AllenNLP biased towards BERT?
At my University's research group we have been pre-training a RoBERTa model for Portuguese and also a domain-specific one, also based on RoBERTa. We have been conducting a series of benchmarks using ...
0
votes
0
answers
95
views
allennlp - ImportError: cannot import name 'OrderedDict'
tried looking for answers to the same problem but to no avail.
So I trained my own bidirectional language model which I now want to apply, but when I try to import ...
0
votes
0
answers
83
views
Semantic Role Labeling tag issue
I am trying to extract causal arguments at the sentence level. so far, my code works but somehow returns the wrong arguments.
Such that: SRL demo
for sentence
'Our results may be materially adversely ...
0
votes
1
answer
20
views
Why are metrics in AllenNLP calculated with tensors? Can I define a metric based on strings?
I'm using AllenNLP in my project, and I'm confused by the Metric: all of the metrics are calculated with tensors, include bleu and rouge. However sometime I may want to calculate the metric with ...
0
votes
0
answers
24
views
Different output tensor of PretrainedTransformerEmbedder in versions 2.9.3 and 1.0
We have a problem. We had used AllenNLP version 1.0, and then updated to version 2.9.3. Although we did not re-train our models after update they are making different predictions compare to their ...
1
vote
1
answer
194
views
Allennlp: How to use CPU instead of GPU?
I'm running some code that works when there is GPU. But I'm trying to figure out how to run it locally with CPU. Here's the error:
2022-07-06 17:58:39,042 - INFO - allennlp.common.plugins - Plugin ...
0
votes
0
answers
44
views
I get "Buffered data was truncated after reaching the output size limit.", my session still running
I'm running code to predict and show the result. After a number of iteration and time, I got message "Buffered data was truncated after reaching the output size limit." and my session still ...
0
votes
1
answer
150
views
Adding a pretrained model outside of AllenNLP to the AllenNLP demo
I am working on the interpretability of models. I want to use AllenAI demo to check the saliency maps and adversarial attack methods (implemented in this demo) on some other models. I use the tutorial ...
1
vote
1
answer
554
views
RuntimeError: Expected 3-dimensional tensor, but got 2-dimensional tensor for argument
I have two tensors names: 'wy' and 'x', both of them with size 8:
wy= tensor([[ 74.2090, -92.9444, 45.2677, -38.4132, -39.8641, -6.9193, 67.4830,
-80.1534]], grad_fn=<AddmmBackward>)
x= ...
1
vote
1
answer
78
views
OOM issues with AllenNLP coreference resolution training and substituting models
I have a few questions about training and evaluating AllenNLP's coreference resolution model.
Are there any constraints/specifications on what GPUs should be used for training? I get an OOM issue ...
0
votes
1
answer
59
views
Replace bidirectional LSTM with GRU in coref?
I am training the coarse-to-fine coreference model (for some other language than English) from Allennlp with template configs from bert_lstm.jsonnet. When I replace the type “lstm” of the context ...
1
vote
1
answer
4k
views
can't import OrderedDict ImportError: cannot import name 'OrderedDict'
I'm trying to run a repo using allennlp. As I run it, I can't import from typing import OrderedDict in ddp_accelerator.py file.
Traceback (most recent call last):
File "train.py", line 10, ...
0
votes
1
answer
308
views
How do I load a fine-tuned AllenNLP BERT-SRL model using BertPreTrainedModel.from_pretrained()?
I have fine-tuned a BERT model for semantic role labeling, using AllenNLP. This produces a model directory (serialization directory, if I recall?) that contains the following:
best.th
config.json
meta....
0
votes
1
answer
156
views
Error training ELMo - RuntimeError: The size of tensor a (5158) must match the size of tensor b (5000) at non-singleton dimension 1
I am trying to train my own custom ELMo model on AllenNLP.
The following bug RuntimeError: The size of tensor a (5158) must match the size of tensor b (5000) at non-singleton dimension 1 arises when ...
0
votes
1
answer
316
views
RuntimeError: Error loading state dict for SrlBert Missing keys: ['bert_model.embeddings.position_ids'] Unexpected keys: []
I am just a beginner in NLP and was trying to learn the Semantic role labeling concept through implementation.
I was trying to load the bert-base-srl model from the public storage of allennlp.
But was ...
0
votes
1
answer
287
views
RuntimeError: RUNTIME ERROR: undefined external variable: jsonlines_embedding_format
When I run the command, ant got this issue. The version of the allennlp is 0.9.
allennlp train /root/code/python/share/scidocs/data/recomm/train_similar_papers_model.json -s /root/code/python/share/...
2
votes
1
answer
269
views
How to change AllenNLP BERT based Semantic Role Labeling to RoBERTa in AllenNLP
Currently i'm able to train a Semantic Role Labeling model using the config file below. This config file is based on the one provided by AllenNLP and works for the default bert-base-uncased model and ...
0
votes
1
answer
429
views
Allennlp: How to load a pretrained ELMo as the embedding of allennlp model?
I am new in allennlp. I trained an elmo model to apply it to other allennlp models as the embedding but failed. It seems that my model is not compatible to the interface the config gives. What can I ...
0
votes
1
answer
27
views
In Allennlp, how can we set "sub_module" argument in PretrainedTransformerMismatchedEmbedder?
As title. I wanted to use BART or T5 as the embedder, and I'd like to use PretrainedTransformerMismatchedEmbedder because after embedding I wanted to do some operations on token level. However I found ...
27
votes
17
answers
251k
views
Message "note: This error originates from a subprocess, and is likely not a problem with pip"
While downloading pip install allennlp==1.0.0 allennlp-models==1.0.0, I faced this problem:
[6 lines of output]
running bdist_wheel
running build
running build_py
...
0
votes
1
answer
118
views
Semantic Role Labeling tensor issue
I have a dataframe in df.sentence column have long sentences. I am trying to extract arg0 with Semantic Role Labeling and save the arg0 in a separate column.
I keep getting this error:
RuntimeError: ...
0
votes
1
answer
102
views
Information about Embeddings in the Allen Coreference Model
I'm an Italian student approaching the NLP world.
First of all I'd like to thank you for the amazing work you've done with the paper " Higher-order Coreference Resolution with Coarse-to-fine ...
1
vote
1
answer
497
views
I'm having trouble downloading allennlp ERROR: No matching distribution found for torch<1.6.0,>=1.5.0
when I try to download pip install allennlp==1.0.0 allennlp-models==1.0.
I am facing this problem :
Microsoft Windows [Version 10.0.22000.469]
(c) Microsoft Corporation. All rights reserved.
C:\Users\...
1
vote
1
answer
427
views
How to interpret Allen NLP Coreference resolution model output?
I am working on extracting people and tasks from texts (multiple sentences) and need a way to resolve coreferencing. I found this model, and it seems very promising, but once I installed the required ...
0
votes
1
answer
57
views
Span-Aste with allennlp - testing against new unseen and unlabeled data
I am trying to use this colab of this github page to extract the triplet [term, opinion, value] from a sentence from my custom dataset.
Here is an overview of the system architecture:
While I can use ...
1
vote
1
answer
149
views
Google mT5-small configuration error because number attention heads is not divider of model dimension
The configuration file for the HuggingFace google/mt5-small Model (https://huggingface.co/google/mt5-small)
defines
{
...
"d_model": 512,
...
"num_heads": 6,
...
}
Link to the ...
0
votes
2
answers
224
views
ConfigurationError: lerc not in acceptable choices for dataset_reader.type
we are trying to use the evaluate_rc-lerc pretrained model provided by allennlp in page
https://docs.allennlp.org/models/main/#pre-trained-models
using below colab code
!pip install allennlp==1.0.0 ...
0
votes
2
answers
41
views
How can I use the AllenNLP framework to embed a label?
Just like using "textfieldembedder" to embed "textfieldtensors", I want to embed labels and convert them into tensors with the same dimension as embedded input texts.
2
votes
1
answer
216
views
Location of downloaded model when using Predictor.from_path in AllenNLP?
I'm following AllenNLP's example code for correference resolution, which has a method Predictor.from_path:
from allennlp.predictors.predictor import Predictor
import allennlp_models.tagging
predictor ...
0
votes
0
answers
92
views
[XAI for transformer custom model using AllenNLP]
I have been solving the NER problem for a Vietnamese dataset with 15 tags in IO format. I have been using the AllenNLP Interpret Toolkit for my model, but I can not configure it completely.
I have ...
0
votes
1
answer
108
views
Writing custom metrics in allennlp
I'm writing down my first allennlp project to detect specific spans in newspaper articles. I was able to have it train on my dataset. The loss computed with cross entropy seems to decrease correctly, ...
0
votes
1
answer
107
views
Using multiprocessing with AllenNLP decoding is sluggish compared to non-multiprocessing case
I'm using the AllenNLP (version 2.6) semantic role labeling model to process a large pile of sentences. My Python version is 3.7.9. I'm on MacOS 11.6.1. My goal is to use multiprocessing.Pool to ...
0
votes
1
answer
150
views
Has anyone done training on custom data using AllenNLP for coreference resolution?
I'm trying to train AllenNLP on custom data instead of using the pre-trained model for coreference resolution. The instructions are here but they are very vague and I am not sure how to progress, in ...
0
votes
1
answer
157
views
How to incorporate ELMo into the simple classification of AllenNLP Guide
I am a beginner and not a native English speaker, so I may ask poor questions.Sorry!
I recently finished the official AllenNLP tutorial(https://guide.allennlp.org/training-and-prediction) and want to ...
0
votes
2
answers
356
views
Loading a HuggingFace model into AllenNLP gives different predictions
I have a custom classification model trained using transformers library based on a BERT model. The model classifies text into 7 different categories. It is persisted in a directory using:
trainer....
3
votes
1
answer
3k
views
Google Colab recently raise error ModuleNotFoundError: No module named 'google.cloud.storage.retry'
My code just worked properly on local and colab, however recently faced the following error on colab.
I use google colab to run my code.
The allennlp package was installed.
Error when run code
0
votes
0
answers
379
views
cannot import name 'AllennlpDataset' from 'allennlp.data.dataset_readers.dataset_reader'
I am trying to implement one research paper. While running this code (https://github.com/abubakar-ucr/LEONA/blob/master/model/end2end_model.py), I keept getting this error. The error occurs at line ...