Copycats commited on
Commit
03d49e4
β€’
1 Parent(s): ff9b323

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Usage
2
+ ```python
3
+ # import library
4
+ import torch
5
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification, TextClassificationPipeline
6
+
7
+ # load model
8
+ tokenizer = AutoTokenizer.from_pretrained("jaehyeong/koelectra-base-v3-finetuned-generalized-sentiment-analysis")
9
+ model = AutoModelForSequenceClassification.from_pretrained("jaehyeong/koelectra-base-v3-finetuned-generalized-sentiment-analysis")
10
+ sentiment_classifier = TextClassificationPipeline(tokenizer=tokenizer, model=model)
11
+
12
+ # target reviews
13
+ review_list = [
14
+ '이쁘고 μ’‹μ•„μš”~~~씻기도 νŽΈν•˜κ³  아이고 μ΄μ˜λ‹€κ³  μžκΈ°λ°©μ— 갖닀놓고 μž˜μ¨μš”~^^',
15
+ '아직 μž…μ–΄λ³΄μ§„ μ•Šμ•˜μ§€λ§Œ ꡉμž₯히 κ°€λ²Όμ›Œμš”~~ λ‹€λ₯Έ 리뷰처럼 어깑이 μ’€ λ˜λ„€μš”γ…‹ λ§Œμ‘±ν•©λ‹ˆλ‹€. μ—„μ²­ λΉ λ₯Έλ°œμ†‘ κ°μ‚¬λ“œλ €μš” :)',
16
+ '재ꡬ맀 ν•œκ±΄λ° λ„ˆλ¬΄λ„ˆλ¬΄ 가성비인거 κ°™μ•„μš”!! λ‹€μŒμ— 또 μƒκ°λ‚˜λ©΄ 3개째 또 μ‚΄λ“―..γ…Žγ…Ž',
17
+ 'κ°€μŠ΅λŸ‰μ΄ λ„ˆλ¬΄ μ μ–΄μš”. 방이 μž‘μ§€ μ•Šλ‹€λ©΄ 무쑰건 ν°κ±Έλ‘œκ΅¬λ§€ν•˜μ„Έμš”. λ¬ΌλŸ‰λ„ μ‘°κΈˆλ°–μ— μ•ˆλ“€μ–΄κ°€μ„œ 쓰기도 λΆˆνŽΈν•¨',
18
+ 'ν•œλ²ˆμž…μ—ˆλŠ”λ° μ˜†μ— λ΄‰μ œμ„  λ‹€ 풀리고 μ‹€λ°₯도 계속 λ‚˜μ˜΅λ‹ˆλ‹€. 마감 처리 λ„ˆλ¬΄ 엉망 μ•„λ‹Œκ°€μš”?',
19
+ 'λ”°λœ»ν•˜κ³  μ’‹κΈ΄ν•œλ° 배솑이 λŠλ €μš”',
20
+ '맛은 μžˆλŠ”λ° 가격이 μžˆλŠ” νŽΈμ΄μ—μš”'
21
+ ]
22
+
23
+ # predict
24
+ for idx, review in enumerate(review_list):
25
+ pred = sentiment_classifier(review)
26
+ print(f'{review}\n>> {pred[0]}')
27
+ ```