hetpandya / paraphrase-datasets-pretrained-models Goto Github PK
View Code? Open in Web Editor NEWA collection of preprocessed datasets and pretrained models for generating paraphrases.
License: Apache License 2.0
A collection of preprocessed datasets and pretrained models for generating paraphrases.
License: Apache License 2.0
Hey, nice work! I tried to run your example script with the german tapaco dataset and the mt5 model instead of t5. When training, I get these warnings:
/usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py:3365: FutureWarning:
`prepare_seq2seq_batch` is deprecated and will be removed in version 5 of HuggingFace Transformers. Use the regular
`__call__` method to prepare your inputs and the tokenizer under the `as_target_tokenizer` context manager to prepare
your targets.
Here is a short example:
model_inputs = tokenizer(src_texts, ...)
with tokenizer.as_target_tokenizer():
labels = tokenizer(tgt_texts, ...)
model_inputs["labels"] = labels["input_ids"]
See the documentation of your specific tokenizer for more details on the specific arguments to the tokenizer of choice.
For a more complete example, see the implementation of `prepare_seq2seq_batch`.
warnings.warn(formatted_warning, FutureWarning)
Using Adafactor for T5
Epoch 1 of 1: 100%
1/1 [4:37:28<00:00, 16648.54s/it]
Epochs 0/1. Running Loss: nan: 100%
9347/9347 [4:37:23<00:00, 1.38s/it]
/usr/local/lib/python3.7/dist-packages/torch/optim/lr_scheduler.py:134: UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`. In PyTorch 1.1.0 and later, you should call them in the opposite order: `optimizer.step()` before `lr_scheduler.step()`. Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
"https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate", UserWarning)
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
WARNING:root:NaN or Inf found in input tensor.
(584, nan)
As you can see, the training did finish and the model was saved. But when i try to generate paraphrases, I get these weird outputs
Generating outputs: 100%
1/1 [00:00<00:00, 1.60it/s]
Decoding outputs: 100%
5/5 [00:01<00:00, 1.65s/it]
[['<extra_id_0>.',
'<extra_id_0>.',
'<extra_id_0>',
'<extra_id_0>) <extra_id_36> ein.',
'<extra_id_0> waren']]
I trained the model only for one epoch instead of four. Is this the reason for this or these warnings while training? Another thing I didn't quite understand is the dataset. In your example (and in the german part of tapaco) there are text and paraphrase pairs which are not paraphrases. For example the second your in your example notebook:
dataset_df.head()
Text | Paraphrase | |
---|---|---|
I ate the cheese. | I eat cheese. | |
I'm eating a yogurt. | I'm eating cheese. | |
I'm having some cheese. | I eat some cheese. | |
It's Monday. | It is Monday today. | |
It's Monday today. | Today is Monday. |
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.