billy-inn / hrere Goto Github PK
View Code? Open in Web Editor NEWHeterogeneous Representations for Neural Relation Extraction https://arxiv.org/abs/1903.10126
License: MIT License
Heterogeneous Representations for Neural Relation Extraction https://arxiv.org/abs/1903.10126
License: MIT License
I'm trying to reproduce your results and I've downloaded and installed your tools, and by following your tutorial I managed to reach this point:
(tensorflow) a017873@yomite:~/development/relationship_extraction/HRERE$ python task.py --model best_real_hrere --eval 10 --runs 10
Loading data...
0%| | 0/10 [00:00<?, ?it/s, best loss: ?]
Traceback (most recent call last):
File "task.py", line 326, in <module>
main(options)
File "task.py", line 320, in main
optimizer.run()
File "task.py", line 291, in run
tpe.suggest, self.max_evals, trials)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 388, in fmin
show_progressbar=show_progressbar,
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/base.py", line 639, in fmin
show_progressbar=show_progressbar)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 407, in fmin
rval.exhaust()
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 262, in exhaust
self.run(self.max_evals - n_done, block_until_done=self.asynchronous)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 227, in run
self.serial_evaluate()
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 141, in serial_evaluate
result = self.domain.evaluate(spec, ctrl)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/base.py", line 844, in evaluate
rval = self.fn(pyll_rval)
File "task.py", line 275, in _obj
self.task = Task(self.model_name, self.runs, param_dict, self.logger)
File "task.py", line 24, in __init__
words, positions, heads, tails, labels = pkl_utils._load(config.GROUPED_TRAIN_DATA)
File "/home/a017873/development/relationship_extraction/HRERE/utils/pkl_utils.py", line 8, in _load
with open(fname, "rb") as f:
FileNotFoundError: [Errno 2] No such file or directory: './data/grouped_train.pkl'
I looked everywhere and could not find this file. Am I missing something?
Thank you in advance
Hi there,
Thank you very much for your sharing. I read your thesis and try to run your code,.
During the data downloading process, I could not access to https://docs.google.com/uc even if using a proxy. Could you share your google drive folder link?
Dear Authors,
The NYT dataset has 57+1 relation types however, in your rel2id.txt, there are only 54+1 relation types. What is the cause of such discrepancy? How should we mitigate such an issue?
I'm sorry, again me. I've tried again the whole process from scratch, and I've reached until the same point as #2 but now I have a new error:
(tensorflow) a017873@yomite:~/development/relationship_extraction/HRERE$ python task.py --model best_real_hrere --eval 10 --runs 10
Loading data...
0%| | 0/10 [00:00<?, ?it/s, best loss: ?]/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/smart_open/smart_open_lib.py:398: UserWarning: This function is deprecated, use smart_open.open instead. See the migration notes for details: https://github.com/RaRe-Technologies/smart_open/blob/master/README.rst#migrating-to-the-new-open-function
'See the migration notes for details: %s' % _MIGRATION_NOTES_URL
101397 unique tokens have been found!
Preprocessing data...
0%| | 0/10 [07:40<?, ?it/s, best loss: ?]
Traceback (most recent call last):
File "task.py", line 326, in <module>
main(options)
File "task.py", line 320, in main
optimizer.run()
File "task.py", line 291, in run
tpe.suggest, self.max_evals, trials)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 388, in fmin
show_progressbar=show_progressbar,
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/base.py", line 639, in fmin
show_progressbar=show_progressbar)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 407, in fmin
rval.exhaust()
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 262, in exhaust
self.run(self.max_evals - n_done, block_until_done=self.asynchronous)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 227, in run
self.serial_evaluate()
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/fmin.py", line 141, in serial_evaluate
result = self.domain.evaluate(spec, ctrl)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/hyperopt/base.py", line 844, in evaluate
rval = self.fn(pyll_rval)
File "task.py", line 275, in _obj
self.task = Task(self.model_name, self.runs, param_dict, self.logger)
File "task.py", line 61, in __init__
self.entity_embedding = np.load(config.ENTITY_EMBEDDING)
File "/home/a017873/.conda/envs/tensorflow/lib/python3.7/site-packages/numpy/lib/npyio.py", line 422, in load
fid = open(os_fspath(file), "rb")
FileNotFoundError: [Errno 2] No such file or directory: './data/entity.npy'
(tensorflow) a017873@yomite:~/development/relationship_extraction/HRERE$ cd data/
Here the files inside data
:
(tensorflow) a017873@yomite:~/development/relationship_extraction/HRERE/data$ ls
entity1.npy entity2.npy grouped_test.pkl prepare_data.py relation2id.txt test.tsv train.tsv triples.csv
entity2id.txt glove.840B.300d.txt grouped_train.pkl relation1.npy relation2.npy test.txt train.txt
Thank you in advance
Luca
python eval.py --model <model_name> --prefix <file_prefix> --runs <number_of_runs>
Can you give me an example of <file_prefix>
Thank you!
Hi there,
Thanks for the code. It would have been much nicer if you would have also included the code for saving the trained model (e.g. while running eval.py
) and than reloading the model to run prediction.
Moreover, with the current code if I run the eval.py
, ComplexHRERE::evaluate(..)
is called, and it is not even checked if the current model state has the best score on validation set :/
Could you be so kind to offer your PR-curve data points of you modle, so that successors can compare their new models with yours more easily ?
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.