jimim commited on
Commit
2dd5ffb
1 Parent(s): 9344673

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +15 -5
README.md CHANGED
@@ -1,14 +1,24 @@
1
  # KoGPT2-emotion-chatbot
 
2
  - [full project link](https://github.com/jiminAn/Capstone_2022)
3
 
4
- ## model description
5
  ## how to use
6
- '''
7
- if
8
- '''
 
 
 
 
 
 
 
 
 
9
  ## dataset finetuned on
10
  - [wellness dataset](https://aihub.or.kr/opendata/keti-data/recognition-laguage/KETI-02-006)
11
  - [emotion corpus of conversations](https://aihub.or.kr/opendata/keti-data/recognition-laguage/KETI-02-010)
12
  - [chatbot data](https://jeongukjae.github.io/tfds-korean/datasets/korean_chatbot_qa_data.html)
13
  ## references
14
- - [WelllnessConversation-LanguageModel](https://github.com/nawnoes/WellnessConversation-LanguageModel)
 
 
1
  # KoGPT2-emotion-chatbot
2
+ kogpt2 on hugging face Transformers for Psychological Counseling
3
  - [full project link](https://github.com/jiminAn/Capstone_2022)
4
 
 
5
  ## how to use
6
+ ```
7
+ from transformers import GPT2LMHeadModel, PreTrainedTokenizerFast
8
+
9
+ model = GPT2LMHeadModel.from_pretrained("withU/kogpt2-emotion-chatbot")
10
+ tokenizer = PreTrainedTokenizerFast.from_pretrained("withU/kogpt2-emotion-chatbot")
11
+
12
+ input_ids = tokenizer.encode("안녕", add_special_tokens=False, return_tensors="pt")
13
+ output_sequences = model.generate(input_ids=input_ids, do_sample=True, max_length=80, num_return_sequences=4)
14
+ for generated_sequence in output_sequences:
15
+ generated_sequence = generated_sequence.tolist()
16
+ print("GENERATED SEQUENCE : {0}".format(tokenizer.decode(generated_sequence, clean_up_tokenization_spaces=True)))
17
+ ```
18
  ## dataset finetuned on
19
  - [wellness dataset](https://aihub.or.kr/opendata/keti-data/recognition-laguage/KETI-02-006)
20
  - [emotion corpus of conversations](https://aihub.or.kr/opendata/keti-data/recognition-laguage/KETI-02-010)
21
  - [chatbot data](https://jeongukjae.github.io/tfds-korean/datasets/korean_chatbot_qa_data.html)
22
  ## references
23
+ - [WelllnessConversation-LanguageModel](https://github.com/nawnoes/WellnessConversation-LanguageModel)
24
+ - [KoGPT2: SKT-AI](https://github.com/SKT-AI/KoGPT2)