ehdwns1516
commited on
Commit
·
efa02ed
1
Parent(s):
26bb9e5
Create README.md
Browse files
README.md
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# ehdwns1516/gpt3-kor-based_gpt2_review_SR1
|
2 |
+
|
3 |
+
* This model has been trained Korean dataset as a star of 1 in the [naver shopping reivew dataset](https://github.com/bab2min/corpus/tree/master/sentiment).
|
4 |
+
* Input text what you want to generate review.
|
5 |
+
* If the context is longer than 1200 characters, the context may be cut in the middle and the result may not come out well.
|
6 |
+
|
7 |
+
review generator DEMO: [Ainize DEMO](https://main-review-generator-ehdwns1516.endpoint.ainize.ai/)
|
8 |
+
|
9 |
+
review generator API: [Ainize API](https://ainize.web.app/redirect?git_repo=https://github.com/ehdwns1516/review_generator)
|
10 |
+
|
11 |
+
## Model links for each 1 to 5 star
|
12 |
+
* [ehdwns1516/gpt3-kor-based_gpt2_review_SR1](https://huggingface.co/ehdwns1516/gpt3-kor-based_gpt2_review_SR1)
|
13 |
+
* [ehdwns1516/gpt3-kor-based_gpt2_review_SR2](https://huggingface.co/ehdwns1516/gpt3-kor-based_gpt2_review_SR2)
|
14 |
+
* [ehdwns1516/gpt3-kor-based_gpt2_review_SR3](https://huggingface.co/ehdwns1516/gpt3-kor-based_gpt2_review_SR3)
|
15 |
+
* [ehdwns1516/gpt3-kor-based_gpt2_review_SR4](https://huggingface.co/ehdwns1516/gpt3-kor-based_gpt2_review_SR4)
|
16 |
+
* [ehdwns1516/gpt3-kor-based_gpt2_review_SR5](https://huggingface.co/ehdwns1516/gpt3-kor-based_gpt2_review_SR5)
|
17 |
+
|
18 |
+
## Overview
|
19 |
+
|
20 |
+
Language model: [gpt3-kor-small_based_on_gpt2](https://huggingface.co/kykim/gpt3-kor-small_based_on_gpt2)
|
21 |
+
|
22 |
+
Language: Korean
|
23 |
+
|
24 |
+
Training data: review_body dataset with a star of 1 in the [amazon_review dataset](https://huggingface.co/datasets/amazon_reviews_multi).
|
25 |
+
|
26 |
+
Code: See [Ainize Workspace](https://ainize.ai/workspace/create?imageId=hnj95592adzr02xPTqss&git=https://github.com/ehdwns1516/gpt2_review_fine-tunning_note)
|
27 |
+
|
28 |
+
## Usage
|
29 |
+
## In Transformers
|
30 |
+
|
31 |
+
```
|
32 |
+
from transformers import AutoTokenizer, AutoModelWithLMHead
|
33 |
+
|
34 |
+
tokenizer = AutoTokenizer.from_pretrained("ehdwns1516/gpt3-kor-based_gpt2_review_SR1")
|
35 |
+
|
36 |
+
model = AutoModelWithLMHead.from_pretrained("ehdwns1516/gpt3-kor-based_gpt2_review_SR1")
|
37 |
+
|
38 |
+
generator = pipeline(
|
39 |
+
"text-generation",
|
40 |
+
model="ehdwns1516/gpt3-kor-based_gpt2_review_SR1",
|
41 |
+
tokenizer=tokenizer
|
42 |
+
)
|
43 |
+
|
44 |
+
context = "your context"
|
45 |
+
|
46 |
+
result = dict()
|
47 |
+
result[0] = generator(context)[0]
|
48 |
+
```
|