DFKI-NLP / DISTRE

[ACL 19] Fine-tuning Pre-Trained Transformer Language Models to Distantly Supervised Relation Extraction
https://www.aclweb.org/anthology/P19-1134
Apache License 2.0
85 stars 13 forks source link

the sorting keys? #3

Open charosen opened 4 years ago

charosen commented 4 years ago

Hi:

Thanks for the awesome contributions.

I notice there is sorting keys params in your config, but it seems like _create_batches of BagIterator doesn't use those keys to sort Bags/Instances in your repo.

So I wonder if you actually implement the sorting. If you do, how do you implement the sorting?

charosen commented 4 years ago

Hi, @ChristophAlt

I have difficulty in reproducing result auc 0.422 provided by your Trained Models.

I train the model in your repo via model_paper.json, and can only get the result auc 0.413, with following settings:

  1. nyt data: Google Drive or Tsinghua Cloud
  2. Python 3.6.8
  3. AllenNLP 0.7.1
  4. Pytorch 1.0.1
  5. Spacy 2.0.18
  6. en_core_web_sm 2.2.5

Also, i notice your Trained Model's vocabulary contain 58 relations, not 53 relations. Could you share:

ssnvxia commented 4 years ago

Hi, @ChristophAlt

您好,我无法运行这个代码,按照作者提示输入训练命令之后会报错 Traceback (most recent call last): File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/run.py", line 18, in main(prog="allennlp") File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/commands/init.py", line 72, in main args.func(args) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/commands/train.py", line 111, in train_model_from_args args.force) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/commands/train.py", line 142, in train_model_from_file return train_model(params, serialization_dir, file_friendly_logging, recover, force) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/commands/train.py", line 282, in train_model all_datasets = datasets_from_params(params) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/commands/train.py", line 149, in datasets_from_params dataset_reader = DatasetReader.from_params(params.pop('dataset_reader')) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/common/from_params.py", line 274, in from_params return subclass.from_params(params=params, extras) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/common/from_params.py", line 285, in from_params kwargs = create_kwargs(cls, params, extras) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/common/from_params.py", line 182, in create_kwargs value_dict[key] = value_cls.from_params(params=value_params, extras) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/common/from_params.py", line 274, in from_params return subclass.from_params(params=params, extras) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/site-packages/allennlp/common/from_params.py", line 287, in from_params return cls(**kwargs) # type: ignore File "/home/mxl/sym/TFRE/tre/byte_pair_indexer.py", line 67, in init encoder_name = next(m.name for m in tmp.getmembers() if 'encoder_bpe' in m.name) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/tarfile.py", line 1759, in getmembers self._load() # all members, we first have to File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/tarfile.py", line 2356, in _load tarinfo = self.next() File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/tarfile.py", line 2287, in next self.fileobj.seek(self.offset - 1) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/gzip.py", line 368, in seek return self._buffer.seek(offset, whence) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/_compression.py", line 143, in seek data = self.read(min(io.DEFAULT_BUFFER_SIZE, offset)) File "/home/mxl/package/yes/envs/python3.6.6/lib/python3.6/gzip.py", line 482, in read raise EOFError("Compressed file ended before the " EOFError: Compressed file ended before the end-of-stream marker was reached

可否麻烦您把您运行的代码发给我一份呢?

ssnvxia commented 4 years ago

Hi, @ChristophAlt哈哈哈,不用了,代码已经跑起来了,是因为版本问题。