Code Monkey home page Code Monkey logo

comformer's People

Contributors

ntdxyg avatar scs4hybrid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

comformer's Issues

python train.py → ValueError: Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers.

Hi! I get an error when i run python train.py
How can I fix this?

$ python train.py

Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
INFO:simpletransformers.seq2seq.seq2seq_utils: Creating features from dataset file at cache_dir/
 10%|███▍                               | 43979/445813 [02:17<19:16, 347.51it/s]Traceback (most recent call last):
  File "train.py", line 73, in <module>
    model.train_model(train_df, eval_data=eval_df, Rouge=getListRouge)
  File "/home/gpuadmin/home/ComFormer/bart_model.py", line 176, in train_model
    train_dataset = self.load_and_cache_examples(train_data, verbose=verbose)
  File "/home/gpuadmin/home/ComFormer/bart_model.py", line 868, in load_and_cache_examples
    dataset = SimpleSummarizationDataset(encoder_tokenizer, self.args, data, mode)
  File "/home/gpuadmin/anaconda3/envs/venv/lib/python3.7/site-packages/simpletransformers/seq2seq/seq2seq_utils.py", line 425, in __init__
    preprocess_fn(d) for d in tqdm(data, disable=args.silent)
  File "/home/gpuadmin/anaconda3/envs/venv/lib/python3.7/site-packages/simpletransformers/seq2seq/seq2seq_utils.py", line 425, in <listcomp>
    preprocess_fn(d) for d in tqdm(data, disable=args.silent)
  File "/home/gpuadmin/anaconda3/envs/venv/lib/python3.7/site-packages/simpletransformers/seq2seq/seq2seq_utils.py", line 333, in preprocess_data_bart
    truncation=True,
  File "/home/gpuadmin/anaconda3/envs/venv/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2651, in batch_encode_plus
    **kwargs,
  File "/home/gpuadmin/anaconda3/envs/venv/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 731, in _batch_encode_plus
    first_ids = get_input_ids(ids)
  File "/home/gpuadmin/anaconda3/envs/venv/lib/python3.7/site-packages/transformers/tokenization_utils.py", line 712, in get_input_ids
    "Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers."
ValueError: Input is not valid. Should be a string, a list/tuple of strings or a list/tuple of integers.

Thanks!

training performance issue

Hi,
Thanks you very much for your work.
I'm using your model and I'm having trouble getting a pretrained model from scratch as good as yours.
Here are the best results I got :

  • BLEU : 0.20907722516675964
  • ROUGE-L : 0.19650848830796055
  • METEOR : 0.3384904110878787
    Could you tell what set of parameters you used?
    Thanks,

question about evaluating model

hi, how to evaluate model on test set?
in train.py, test.csv is loaded but not used. In use.py, the demo does not seems to be suitable for batch generating
so I tried to introduce the parameters in use.py into BartModel and call the function eval_model of the class BartModel to eval the test set. the test set is from Hybrid-DeepCom and preprocessed by utils.transformer as #7 mentioned . the model i use is the pretrained model 'NTUYG/ComFormer'
however, the result is

INFO:bart_model:{'eval_loss': 5.0416509765625, 'getListRouge': 0.5193519200892092}

the ROUGE score is about 10.0 lower than that mentioned in the paper
is this method ok ?
thanks for your answer in advance

Cuda out of memory, 0 bytes free

Hello, I contact you because when we are trying to test your model on our dataset using cuda. We get an error about memory problem.
MicrosoftTeams-image
We are testing it with a Nvidia 2080.
Do you have any ideas where the problem could be coming from?
Thanks for your great work !

AST issue

Hello again, now we have trouble testing the model because we have an error about ast assignments.
MicrosoftTeams-image (2)
We have this error on many functions but not on each one. Any idea?
Have a good day !

后续更新咨询

感谢您的分享,请问后续是否会更新论文中提到的源码和数据集部分?如有更新,不胜感激

再次感谢您的分享~

Problem in early stopping

Hello again !

In bart_model.py line 522 : if results[args.early_stopping_metric] - best_eval_metric < args.early_stopping_delta:
We had trouble with the model stopping too early even if the metric getListRouge had a new best score.
So we think that the sign less than should be greater than. What do you think?

Key Error : input_text_a when execute train.py

Hello :)
I was impressed with your Comformer thesis so I tried your Comformer code.
As it says in README.md, we made csv file with 2 columns (input_text, target_text).
However, when I run "python train.py", the key error is occured.
--> Key Error : input_text_a

How to resolve it?
Thank you.

This is error description.

(ym37) gpuadmin@gpuadmin:~/youngmi/ComFormer$ python train.py
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
INFO:simpletransformers.seq2seq.seq2seq_utils: Creating features from dataset file at cache_dir/
Traceback (most recent call last):
File "/home/gpuadmin/anaconda3/envs/ym37/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2895, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1675, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1683, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'input_text_a'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "train.py", line 75, in
model.train_model(train_df, eval_data=eval_df, Rouge=Rouge)
File "/home/gpuadmin/youngmi/ComFormer/bart_model.py", line 176, in train_model
train_dataset = self.load_and_cache_examples(train_data, verbose=verbose)
File "/home/gpuadmin/youngmi/ComFormer/bart_model.py", line 868, in load_and_cache_examples
dataset = SimpleSummarizationDataset(encoder_tokenizer, self.args, data, mode)
File "/home/gpuadmin/youngmi/ComFormer/simpletransformers/seq2seq/seq2seq_utils.py", line 383, in init
data["input_text_a"], data["input_text_b"], data["target_text"]
File "/home/gpuadmin/anaconda3/envs/ym37/lib/python3.7/site-packages/pandas/core/frame.py", line 2902, in getitem
indexer = self.columns.get_loc(key)
File "/home/gpuadmin/anaconda3/envs/ym37/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2897, in get_loc
raise KeyError(key) from err
KeyError: 'input_text_a'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.