204 questions
0
votes
0
answers
784
views
ImportError: cannot import name 'msvccompiler' from 'distutils'
I am trying to install the neuralcoref and allennlp library using pip in my virtual environment with Python 3.12.3. I am using visual studio code as my editor. Some sort of dependency error always ...
0
votes
0
answers
16
views
Being unabe to transfer an allen.nlp.Elmo model and character_ids on the same device
I am trying to measure the speed at which elmo model from the allen.nlp library performs on CPU and T4 GPU on google collab.
The eval function accepts a function that makes sentence embedding with the ...
0
votes
0
answers
240
views
Unable to install jsonnet in Google Colab notebook: failed building wheel
I need to install the following using Python 3.8 in Google Colab:
!pip install allennlp==1.3
!pip install transformers==4.0.0
!pip install torch==1.7.0
!pip install networkx
However, I'm getting this ...
0
votes
1
answer
146
views
Allennlp 2.10.1 Predictor throws "Not implemented" and "KeyError" Errors
I'm trying to use Allennlp's Predictor for Correference Resolution. It works fine in Google Colab, but altough the dependencies are identical it throws an error when I tried the same code in my local. ...
0
votes
0
answers
54
views
Why the training time of CRF module from allennlp is higher?
I have build a custom Model in pytorch with a BERT + BiLSTM + CRF architecture. For the CRF layer I have used the allennlp's CRF module. Due to the CRF module the training and inference time increases ...
2
votes
0
answers
4k
views
InvalidVersion: Invalid version: '0.10.1,<0.11' in Colab when trying to "from allennlp.nn.util import sort_batch_by_length, masked_softmax"
I was using this for a couple of months just fine in Colab. But when I tired to work with it today I saw this error
InvalidVersion: Invalid version: '0.10.1,<0.11'
the error appears when I try to ...
0
votes
0
answers
31
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
51
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:
...
2
votes
1
answer
447
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
1
answer
132
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
102
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
79
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
147
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
81
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
267
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
205
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
32
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 ...
1
vote
1
answer
460
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
2
answers
291
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 ...
2
votes
1
answer
2k
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:
import torch
wy = torch.tensor([[7.2, -2.9, 5.2, -8.4, -3.8, -6.9, 7.4, -8.1]])
x = torch.tensor([[70., 77., 101., 75., 40., 83., 48., ...
1
vote
1
answer
110
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
131
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 ...
2
votes
1
answer
6k
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
650
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
229
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
1k
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
796
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
429
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 ...
1
vote
1
answer
617
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
35
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 ...
51
votes
21
answers
569k
views
Message "error: Microsoft Visual C++ 14.0 or greater is required."
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
168
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
135
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
1k
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
632
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
92
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
439
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
464
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
58
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
473
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
127
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
151
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
128
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
231
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
232
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
547
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
653
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 ...
1
vote
0
answers
425
views
Predictor.from_path('coref-spanbert-large-2021.03.10.tar.gz') downloads model into cache though I provide a local copy of the model
I am trying to load a local copy of the coref-spanbert model using Predictor.from_path but it starts downloading the model again into cache/huggingface. Can anyone help me to fix this.
>>> ...
1
vote
0
answers
307
views
Predictor.from_archive failed
archive = load_archive(
"elmo-constituency-parser-2018.03.14.tar.gz"
)
predictor = Predictor.from_archive(archive, 'constituency-parser')
predictor.predict_json({"sentence": &...