Commit
·
931a7cc
1
Parent(s):
8df041d
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
| 3 |
base_model: facebook/bart-large-cnn
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
|
@@ -8,6 +8,9 @@ metrics:
|
|
| 8 |
model-index:
|
| 9 |
- name: InstructTweetSummarizer
|
| 10 |
results: []
|
|
|
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
@@ -59,10 +62,27 @@ The following hyperparameters were used during training:
|
|
| 59 |
| 0.5244 | 2.0 | 834 | 0.3440 | 46.9139 | 24.683 | 35.3699 | 35.333 | 119.65 |
|
| 60 |
| 0.2061 | 3.0 | 1251 | 0.3548 | 47.5134 | 24.7121 | 35.7366 | 35.6499 | 111.96 |
|
| 61 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
|
| 63 |
### Framework versions
|
| 64 |
|
| 65 |
- Transformers 4.34.1
|
| 66 |
- Pytorch 2.1.0
|
| 67 |
- Datasets 2.14.7
|
| 68 |
-
- Tokenizers 0.14.1
|
|
|
|
| 1 |
---
|
| 2 |
+
license: other
|
| 3 |
base_model: facebook/bart-large-cnn
|
| 4 |
tags:
|
| 5 |
- generated_from_trainer
|
|
|
|
| 8 |
model-index:
|
| 9 |
- name: InstructTweetSummarizer
|
| 10 |
results: []
|
| 11 |
+
language:
|
| 12 |
+
- en
|
| 13 |
+
pipeline_tag: summarization
|
| 14 |
---
|
| 15 |
|
| 16 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 62 |
| 0.5244 | 2.0 | 834 | 0.3440 | 46.9139 | 24.683 | 35.3699 | 35.333 | 119.65 |
|
| 63 |
| 0.2061 | 3.0 | 1251 | 0.3548 | 47.5134 | 24.7121 | 35.7366 | 35.6499 | 111.96 |
|
| 64 |
|
| 65 |
+
### How to use
|
| 66 |
+
|
| 67 |
+
Here is how to use this model with the [pipeline API](https://huggingface.co/transformers/main_classes/pipelines.html):
|
| 68 |
+
|
| 69 |
+
```python
|
| 70 |
+
from transformers import pipeline
|
| 71 |
+
summarizer = pipeline("summarization", model="Sidharthkr/InstructTweetSummarizer")
|
| 72 |
+
def summarymaker(instruction = "", tweets = ""):
|
| 73 |
+
ARTICLE = f"""[INST] {instruction} [/INST] \\n [TWEETS] {tweets} [/TWEETS]"""
|
| 74 |
+
out = summarizer(ARTICLE, max_length=130, min_length=10, do_sample=False)
|
| 75 |
+
out = out[0]['summary_text'].split("[SUMMARY]")[-1].split("[/")[0].split("[via")[0].strip()
|
| 76 |
+
return out
|
| 77 |
+
|
| 78 |
+
summarymaker(instruction = "Summarize the tweets for Stellantis in 100 words",
|
| 79 |
+
tweets = """Stellantis - arch critic of Chinese EVs coming to Europe - is in talks with CATL to build a European plant. \n\nIt has concluded that cutting the price of EVs by using Chinese LFP batteries is more important.\n\n@FT story: \nhttps://t.co/l7nGggRFxH. State-of-the-art North America Battery Technology Centre begins to take shape at Stellantis' Automotive Research and Development Centre (ARDC) in Windsor, Ontario.\n\nhttps://t.co/04RO7CL1O5. RT @UAW: 🧵After the historic Stand Up Strike, UAW members at Ford, General Motors and Stellantis have voted to ratify their new contracts,…. RT @atorsoli: Stellantis and CATL are set to supply lower-cost EV batteries together for Europe, signaling automaker's efforts to tighten t…. RT @atorsoli: Stellantis and CATL are set to supply lower-cost EV batteries together for Europe, signaling automaker's efforts to tighten""")
|
| 80 |
+
>>> 'Stellantis is in talks with CATL to build a European plant, with a focus on cutting the price of EVs by using Chinese LFP batteries. The company is also developing a state-of-the-art North America Battery Technology Centre in Windsor, Ontario, and has ratified its new contracts with the UAW.'
|
| 81 |
+
```
|
| 82 |
|
| 83 |
### Framework versions
|
| 84 |
|
| 85 |
- Transformers 4.34.1
|
| 86 |
- Pytorch 2.1.0
|
| 87 |
- Datasets 2.14.7
|
| 88 |
+
- Tokenizers 0.14.1
|