File size: 1,074 Bytes
58b2f0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1fe4a4e
58b2f0e
 
 
1fe4a4e
 
58b2f0e
 
 
 
 
 
1fe4a4e
 
 
 
 
 
 
 
 
58b2f0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
---
license: mit
language:
- en
library_name: transformers
tags:
- Question Answering
datasets:
- yahoo_answers_qa
metrics:
- rouge
---

# Y5 Bot

Y5 Bot is a text2text transfer transformer model working in English Language.

It is lightweight, fast, and easy to use for text generation.

Y5 Bot can answer and generate text short to the main points.

# How to use

```
pip install transformers
```

## pipeline approach

```python
from transformers import pipeline

generator = pipeline(model="jojo-ai-mst/Y5Bot")
generator("What is Artificial Intelligence?")
```

```python
model = T5ForConditionalGeneration.from_pretrained("jojo-ai-mst/Y5Bot")
tokenizer = T5Tokenizer.from_pretrained("jojo-ai-mst/Y5Bot")

my_question = "What do you think about the benefit of Artificial Intelligence?"
inputs = "Please answer to this question: " + my_question

inputs = tokenizer(inputs, return_tensors="pt")
outputs = model.generate(**inputs)
answer = tokenizer.decode(outputs[0])

print(answer)
```

# References

- [https://arxiv.org/abs/1910.10683](https://arxiv.org/abs/1910.10683)