Questions tagged [allennlp]

An open-source NLP research library, built on PyTorch

An Apache 2.0 NLP research library, built on PyTorch, for developing state-of-the-art deep learning models on a wide variety of linguistic tasks.

Quick Links

210 questions
0
votes
1 answer

How to write the config file for pair classification model in AllenNLP git repo?

I'm trying to run the pair classification model in AllenNLP repo via config file. It is appreciated that the repo gives sample of datareader and model file. But without a corresponding config file, I cannot really run the model. The example config…
0
votes
1 answer

Saliency score keeps changing allennlp

I am trying to get the saliency score for sentiment analysis task. Every time I run the code I get different saliency scores. Should this be the case? I am attaching my code for more reference. from allennlp.predictors.predictor import…
0
votes
1 answer

AllenNLP: How to know which index of the output-tensor corresponds to which class

I am using allennlp 2.1 and I would like to pass class weights to the pytorch-cross-entropy loss function that I use. @Head.register('model_head_two_layers') class ModelHeadTwoLayers(Head): default_predictor = 'head_predictor' def…
sinaj
  • 129
  • 1
  • 1
  • 10
0
votes
1 answer

Fine-tune a reading comprehension model

System OS: Ubuntu Python version: 3.6.7 AllenNLP version: 1.0.0 QUESTION: With the following command I am able to train the model but I can't tell if the weights are being updated for fine-tuning or its just training a new model? I am trying to fine…
AMACK13
  • 63
  • 3
  • 6
0
votes
1 answer

How to write a configuration file to tell the AllenNLP trainer to randomly split dataset into train and dev

The official document of AllenNLP suggests specifying "validation_data_path" in the configuration file, but what if one wants to construct a dataset from a single source and then randomly split it into train and validation datasets with a given…
alicec
  • 59
  • 3
0
votes
1 answer

Active Learning in AllenNLP v2.0.1

I tried implementing an Active Learning procedure in AllenNLP v2.0.1 . However, with the current GradientDescentTrainer implementation, I am unable to continue training on a new batch of Instance. The model (also trained using AllenNLP) has finished…
Ihan Dilnath
  • 343
  • 2
  • 9
0
votes
0 answers

Allennlp: AttributeError: 'zipimport.zipimporter' object has no attribute 'path'

when trying to run AllenNLP train command, I ran into this Error. 2021-02-25 02:57:40,043 - INFO - allennlp.common.plugins - Plugin allennlp_models available Traceback (most recent call last): File…
0
votes
1 answer

AllenNLP - configuration to write test set metrics to Tensorboard

When running the AllenNLP train or evaluate CLI commands, is there a configuration option (in the json/jsonnet file) to write test set evaluation metrics to Tensorboard? If not, how can I do it in my own script? Thanks in advance for your time and…
Ihan Dilnath
  • 343
  • 2
  • 9
0
votes
1 answer

"AssertionError: Found no field that needed padding; we are surprised you got this error, please open an issue on github" error occured

I got error ("AssertionError: Found no field that needed padding; we are surprised you got this error, please open an issue on github" ). "AssertionError: Found no field that needed padding; we are surprised you got this error, please open an issue…
jhgwak
  • 1
0
votes
1 answer

Cannot register text_classifier as Model; name already in use for TextClassifier

Trying to use text classifier model shared by https://github.com/allenai/scibert/blob/master/scibert/models/text_classifier.py Everything used to work and suddenly I keep getting this error: Cannot register text_classifier as Model; name already in…
gorkem
  • 23
  • 5
0
votes
1 answer

AllenNLP 2.0: Using `allennlp predict` with MultiTaskDatasetReader leads to RuntimeError

I trained a multitask model using allennlp 2.0 and now want to predict on new examples using the allennlp predict command. Problem/Error: I am using the following command: allennlp predict results/model.tar.gz new_instances.jsonl --include-package…
sinaj
  • 129
  • 1
  • 1
  • 10
0
votes
1 answer

AllenNLP Server: pip is looking at multiple versions of each package

Within my Conda environment with Python 3.6.9, I've installed AllenNLP 9.2.0. I tried to install AllenNLP Server following the instruction from https://github.com/allenai/allennlp-server by running pip install --editable . However, the installation…
0
votes
2 answers

AllenNLP DatasetReader: only loads a single instance, instead of iterating over all instances in the training dataset

I am using AllenNLP to train a hierarchical attention network model. My training dataset consists of a list of JSON objects (eg, each object in the list is a JSON object with keys := ["text", "label"]. The value associated with the text key is a…
0
votes
1 answer

AllenNLP: Different Constituency Parsing Using Taskdemo and Python Library

Thank you for sharing your fantastic tool with us. Very excellent job. Just a question, why I got different constituency parsing result between online task demo and local python library? I think both of them are based on this model? For example,…
0
votes
1 answer

As far as I can tell, there is no way to parameterize character strings in an AllenNLP config file --- only ints or floats

So the issue is that, for using autotuning (like optuna) with AllenNLP, the suggested practice is to use, in jsonnet scripts, references to environment variables, and then to set up a study to modify those parameters. That works fine, when the…
Jim Cox
  • 13
  • 3