neulab / cmu-multinlp Goto Github PK
View Code? Open in Web Editor NEWGeneralizing Natural Language Analysis through Span-relation Representations
License: BSD 3-Clause "New" or "Revised" License
Generalizing Natural Language Analysis through Span-relation Representations
License: BSD 3-Clause "New" or "Revised" License
Hi,
when trying to use the system as described in the ReadMe, I get the following error:
(spanrel) [jant470@jant470 cmu-multinlp]$ ./run_by_config_bert.sh wlp bert-base-uncased output/test
/run_by_config_bert.sh wlp bert-base-uncased output/test
./run_by_config_bert.sh: line 479: jsonnet: command not found
write config to /tmp/tmp.gGgpiCN8Zz
2020-12-07 14:12:56,220 - INFO - pytorch_pretrained_bert.modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
/home/jant470/.local/lib/python3.8/site-packages/sklearn/utils/linear_assignment_.py:18: FutureWarning: The linear_assignment_ module is deprecated in 0.21 and will be removed from 0.23. Use scipy.optimize.linear_sum_assignment instead.
warnings.warn(
2020-12-07 14:12:57,229 - INFO - brat_multitask.modules.bert_modeling - Better speed can be achieved with apex installed from https://www.github.com/nvidia/apex .
Traceback (most recent call last):
File "/home/jant470/.local/bin/allennlp", line 8, in <module>
sys.exit(run())
File "/home/jant470/.local/lib/python3.8/site-packages/allennlp/run.py", line 18, in run
main(prog="allennlp")
File "/home/jant470/.local/lib/python3.8/site-packages/allennlp/commands/__init__.py", line 102, in main
args.func(args)
File "/home/jant470/.local/lib/python3.8/site-packages/allennlp/commands/train.py", line 109, in train_model_from_args
train_model_from_file(args.param_path,
File "/home/jant470/.local/lib/python3.8/site-packages/allennlp/commands/train.py", line 154, in train_model_from_file
params = Params.from_file(parameter_filename, overrides)
File "/home/jant470/.local/lib/python3.8/site-packages/allennlp/common/params.py", line 462, in from_file
file_dict = json.loads(evaluate_file(params_file, ext_vars=ext_vars))
RuntimeError: STATIC ERROR: /tmp/tmp.gGgpiCN8Zz:1:1: unexpected end of file.
(spanrel) [jant470@jant470 cmu-multinlp]$
Any idea how to solve this?
Thanks in advance
Edit: Okay, fixed it, I installed the jsonnet package manually and exported the path.
There's no instruction about MTL across all tasks in README as described in the paper. Can you give me some hints?
Hi Zhengbao, thanks for open-sourcing the code and the detailed instructions for processing data! It seems the wlp
data is missing in the repo (without any link or folder). Is it as expected? Many thanks :)
What is the command that I can use in order to run the predictor.
And is it possible to only predict on one instance ?
Hi Zhengbao,
Thank you for providing the code. I am trying to run the code on the SRL task on the CoNLL 2012 tasks. I followed the instructions and encounter an error like this:
Traceback (most recent call last):
File "/home/chao/anaconda3/envs/spanrel/bin/allennlp", line 8, in
sys.exit(run())
File "/home/chao/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/run.py", line 18, in run
main(prog="allennlp")
File "/home/chao/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/init.py", line 102, in main
args.func(args)
File "/home/chao/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/train.py", line 116, in train_model_from_args
args.cache_prefix)
File "/home/chao/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/train.py", line 160, in train_model_from_file
cache_directory, cache_prefix)
File "/home/chao/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/train.py", line 243, in train_model
metrics = trainer.train()
File "/home/chao/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/training/trainer.py", line 497, in train
this_epoch_val_metric = val_metrics[self._validation_metric]
KeyError: 'srl_sp_prf_f'
I try to search srl_sp_prf_f
related code but didn't find anything. I was thinking is it possible a metric file was missing in the /brat_multitask/metrics/
folder? Any help will be appreciated!
Thank you!
Best,
Chao
I want to predict on single sentences using the multinlp pretrained model on SRL using this command
allennlp predict model.tar.gz ner-examples.jsonl --include-package brat_multitask --cuda-device 0 --predictor brat --weights-file best.th --output-file out.json
Unfortunately, I receive a NotImplementedError raised as follows:
Traceback (most recent call last):
File "/home/karthik/anaconda3/envs/spanrel/bin/allennlp", line 8, in <module>
sys.exit(run())
File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/run.py", line 18, in run
main(prog="allennlp")
File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/__init__.py", line 102, in main
args.func(args)
File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/predict.py", line 204, in _predict
manager.run()
File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/predict.py", line 183, in run
for model_input_json, result in zip(batch_json, self._predict_json(batch_json)):
File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/predict.py", line 129, in _predict_json
results = [self._predictor.predict_json(batch_data[0])]
File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/predictors/predictor.py", line 57, in predict_json
instance = self._json_to_instance(inputs)
File "/home/karthik/anaconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/predictors/predictor.py", line 104, in _json_to_instance
raise NotImplementedError
NotImplementedError
Any fix for this?
(allennlp 0.8.4)
Traceback (most recent call last):
File "/home/user/miniconda3/envs/spanrel/bin/allennlp", line 8, in <module>
sys.exit(run())
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/run.py", line 18, in run
main(prog="allennlp")
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/__init__.py", line 102, in main
args.func(args)
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/train.py", line 116, in train_model_from_args
args.cache_prefix)
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/train.py", line 160, in train_model_from_file
cache_directory, cache_prefix)
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/commands/train.py", line 218, in train_model
cache_prefix)
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/training/trainer.py", line 793, in from_params
model = Model.from_params(vocab=vocab, params=params.pop('model'))
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/common/from_params.py", line 365,
in from_params
return subclass.from_params(params=params, **extras)
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/common/from_params.py", line 388,
in from_params
return cls(**kwargs) # type: ignore
File "./brat_multitask/models/brat_multitask.py", line 193, in __init__
bucket_widths=bucket_widths)
File "/home/user/miniconda3/envs/spanrel/lib/python3.6/site-packages/allennlp/modules/span_extractors/endpoint_span_extractor.py", line 72, in __init__
raise ConfigurationError("To use a span width embedding representation, you must"
allennlp.common.checks.ConfigurationError: 'To use a span width embedding representation, you mustspecify both num_width_buckets and span_width_embedding_dim.'
So how to download it? thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.