๐ Wikihow T5-small
A T5-small model trained on Wikihow All dataset for text summarization, achieving specific Rouge scores.
๐ Quick Start
The Wikihow T5-small model is designed for text summarization tasks. It was trained on the Wikihow All dataset.
โจ Features
- Trained on Wikihow: Utilizes the Wikihow All dataset for training.
- Specific Training Parameters: Trained for 3 epochs with a batch size of 16 and a learning rate of 3e - 4.
- Defined Input and Output Lengths: Max_input_length is set as 512 and max_output_length is 150.
- Good Performance Metrics: Attained a Rouge1 score of 31.2 and RougeL score of 24.5.
๐ฆ Installation
No specific installation steps are provided in the original document.
๐ป Usage Examples
Basic Usage
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("deep-learning-analytics/wikihow-t5-small")
model = AutoModelWithLMHead.from_pretrained("deep-learning-analytics/wikihow-t5-small")
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = model.to(device)
text = """
Lack of fluids can lead to dry mouth, which is a leading cause of bad breath. Water
can also dilute any chemicals in your mouth or gut that are causing bad breath., Studies show that
eating 6 ounces of yogurt a day reduces the level of odor-causing compounds in the mouth. In
particular, look for yogurt containing the active bacteria Streptococcus thermophilus or
Lactobacillus bulgaricus., The abrasive nature of fibrous fruits and vegetables helps to clean
teeth, while the vitamins, antioxidants, and acids they contain improve dental health.Foods that can
be particularly helpful include:Apples โ Apples contain vitamin C, which is necessary for health
gums, as well as malic acid, which helps to whiten teeth.Carrots โ Carrots are rich in vitamin A,
which strengthens tooth enamel.Celery โ Chewing celery produces a lot of saliva, which helps to
neutralize bacteria that cause bad breath.Pineapples โ Pineapples contain bromelain, an enzyme that
cleans the mouth., These teas have been shown to kill the bacteria that cause bad breath and
plaque., An upset stomach can lead to burping, which contributes to bad breath. Donโt eat foods that
upset your stomach, or if you do, use antacids. If you are lactose intolerant, try lactase tablets.,
They can all cause bad breath. If you do eat them, bring sugar-free gum or a toothbrush and
toothpaste to freshen your mouth afterwards., Diets low in carbohydrates lead to ketosis โ a state
in which the body burns primarily fat instead of carbohydrates for energy. This may be good for your
waistline, but it also produces chemicals called ketones, which contribute to bad breath.To stop the
problem, you must change your diet. Or, you can combat the smell in one of these ways:Drink lots of
water to dilute the ketones.Chew sugarless gum or suck on sugarless mints.Chew mint leaves.
"""
preprocess_text = text.strip().replace("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\", "")
tokenized_text = tokenizer.encode(preprocess_text, return_tensors="pt").to(device)
summary_ids = model.generate(
tokenized_text,
max_length=150,
num_beams=2,
repetition_penalty=2.5,
length_penalty=1.0,
early_stopping=True
)
output = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
print ("\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Summarized text: \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\", output)
๐ Documentation
For detailed information about the training procedure, please refer to this blog post.
๐ง Technical Details
The model is a T5 - small architecture. It was trained on the Wikihow All dataset for 3 epochs. A batch size of 16 and a learning rate of 3e - 4 were used during training. The max_input_length
is set as 512 and max_output_length
is 150.
๐ License
No license information is provided in the original document.
Property |
Details |
Model Type |
Wikihow T5 - small |
Training Data |
Wikihow All dataset |
Rouge1 |
31.2 |
RougeL |
24.5 |