## Model Description
This is the project for the course Multimedia System in Leiden University 2023 fall. The model is part of self-designed software for the final project that summarizes short texts.
The original summarization model is from https://towardsdatascience.com/text-summarization-with-gpt2-and-layer-ai-599625085d8e .

## Training Datasets
- Amazon review dataset https://www.kaggle.com/datasets/kritanjalijain/amazon-reviews?select=amazon_review_polarity_csv.tgz
- Twitter crawler dataset https://www.kaggle.com/datasets/tripathiharsh/training
- Emotion analysis dataset https://huggingface.co/datasets/dair-ai/emotion
- Kindle review dataset https://www.kaggle.com/datasets/meetnagadia/amazon-kindle-book-review-for-sentiment-analysis/data

## TODO
- Improve training data quality
- Model analysis
- Inference development


## Interface
```python
import requests

API_URL = "https://api-inference.huggingface.co/models/Lin0He/text-summary-gpt2-short"
headers = {"Authorization": "Bearer <Your API tokens>"}

def query(payload):
    response = requests.post(API_URL, headers=headers, json=payload)
    return response.json()
    
output = query({
    "inputs": "Today was a beautiful day. I have down all my homework, and baked some cookies with my friends. What a lovely day."
})
print(output)
```
{"license": "mit", "library_name": "generic", "tags": ["summarization"]}
generic pytorch gpt2 summarization license:mit has_space region:us