avichr commited on
Commit
7ff6b01
โ€ข
1 Parent(s): 982c74d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +38 -38
README.md CHANGED
@@ -27,49 +27,49 @@ In order to validate the annotation, we search for an agreement between raters t
27
  ## How to use
28
  ### For masked-LM model (can be fine-tunned to any down-stream task)
29
  ```
30
- from transformers import AutoTokenizer, AutoModel
31
- tokenizer = AutoTokenizer.from_pretrained("avichr/heBERT")
32
- model = AutoModel.from_pretrained("avichr/heBERT")
33
 
34
- from transformers import pipeline
35
- fill_mask = pipeline(
36
- "fill-mask",
37
- model="avichr/heBERT",
38
- tokenizer="avichr/heBERT"
39
- )
40
- fill_mask("ื”ืงื•ืจื•ื ื” ืœืงื—ื” ืืช [MASK] ื•ืœื ื• ืœื ื ืฉืืจ ื“ื‘ืจ.")
41
  ```
42
 
43
  ### For sentiment classification model (polarity ONLY):
44
  ```
45
- from transformers import AutoTokenizer, AutoModel, pipeline
46
- tokenizer = AutoTokenizer.from_pretrained("avichr/heBERT_sentiment_analysis") #same as 'avichr/heBERT' tokenizer
47
- model = AutoModel.from_pretrained("avichr/heBERT_sentiment_analysis")
48
-
49
- # how to use?
50
- sentiment_analysis = pipeline(
51
- "sentiment-analysis",
52
- model="avichr/heBERT_sentiment_analysis",
53
- tokenizer="avichr/heBERT_sentiment_analysis",
54
- return_all_scores = True
55
- )
56
-
57
- sentiment_analysis('ืื ื™ ืžืชืœื‘ื˜ ืžื” ืœืื›ื•ืœ ืœืืจื•ื—ืช ืฆื”ืจื™ื™ื')
58
- >>> [[{'label': 'natural', 'score': 0.9978172183036804},
59
- >>> {'label': 'positive', 'score': 0.0014792329166084528},
60
- >>> {'label': 'negative', 'score': 0.0007035882445052266}]]
61
-
62
- sentiment_analysis('ืงืคื” ื–ื” ื˜ืขื™ื')
63
- >>> [[{'label': 'natural', 'score': 0.00047328314394690096},
64
- >>> {'label': 'possitive', 'score': 0.9994067549705505},
65
- >>> {'label': 'negetive', 'score': 0.00011996887042187154}]]
66
-
67
- sentiment_analysis('ืื ื™ ืœื ืื•ื”ื‘ ืืช ื”ืขื•ืœื')
68
- >>> [[{'label': 'natural', 'score': 9.214012970915064e-05},
69
- >>> {'label': 'possitive', 'score': 8.876807987689972e-05},
70
- >>> {'label': 'negetive', 'score': 0.9998190999031067}]]
71
  ```
72
-
73
  Our model is also available on AWS! for more information visit [AWS' git](https://github.com/aws-samples/aws-lambda-docker-serverless-inference/tree/main/hebert-sentiment-analysis-inference-docker-lambda)
74
 
75
 
@@ -83,7 +83,7 @@ our git: https://github.com/avichaychriqui/HeBERT
83
  Chriqui, A., & Yahav, I. (2021). HeBERT & HebEMO: a Hebrew BERT Model and a Tool for Polarity Analysis and Emotion Recognition. arXiv preprint arXiv:2102.01909.
84
  ```
85
  @article{chriqui2021hebert,
86
- title={HeBERT \\\\\\\\& HebEMO: a Hebrew BERT Model and a Tool for Polarity Analysis and Emotion Recognition},
87
  author={Chriqui, Avihay and Yahav, Inbal},
88
  journal={arXiv preprint arXiv:2102.01909},
89
  year={2021}
 
27
  ## How to use
28
  ### For masked-LM model (can be fine-tunned to any down-stream task)
29
  ```
30
+ from transformers import AutoTokenizer, AutoModel
31
+ tokenizer = AutoTokenizer.from_pretrained("avichr/heBERT")
32
+ model = AutoModel.from_pretrained("avichr/heBERT")
33
 
34
+ from transformers import pipeline
35
+ fill_mask = pipeline(
36
+ "fill-mask",
37
+ model="avichr/heBERT",
38
+ tokenizer="avichr/heBERT"
39
+ )
40
+ fill_mask("ื”ืงื•ืจื•ื ื” ืœืงื—ื” ืืช [MASK] ื•ืœื ื• ืœื ื ืฉืืจ ื“ื‘ืจ.")
41
  ```
42
 
43
  ### For sentiment classification model (polarity ONLY):
44
  ```
45
+ from transformers import AutoTokenizer, AutoModel, pipeline
46
+ tokenizer = AutoTokenizer.from_pretrained("avichr/heBERT_sentiment_analysis") #same as 'avichr/heBERT' tokenizer
47
+ model = AutoModel.from_pretrained("avichr/heBERT_sentiment_analysis")
48
+
49
+ # how to use?
50
+ sentiment_analysis = pipeline(
51
+ "sentiment-analysis",
52
+ model="avichr/heBERT_sentiment_analysis",
53
+ tokenizer="avichr/heBERT_sentiment_analysis",
54
+ return_all_scores = True
55
+ )
56
+
57
+ >>> sentiment_analysis('ืื ื™ ืžืชืœื‘ื˜ ืžื” ืœืื›ื•ืœ ืœืืจื•ื—ืช ืฆื”ืจื™ื™ื')
58
+ [[{'label': 'natural', 'score': 0.9978172183036804},
59
+ {'label': 'positive', 'score': 0.0014792329166084528},
60
+ {'label': 'negative', 'score': 0.0007035882445052266}]]
61
+
62
+ >>> sentiment_analysis('ืงืคื” ื–ื” ื˜ืขื™ื')
63
+ [[{'label': 'natural', 'score': 0.00047328314394690096},
64
+ {'label': 'possitive', 'score': 0.9994067549705505},
65
+ {'label': 'negetive', 'score': 0.00011996887042187154}]]
66
+
67
+ >>> sentiment_analysis('ืื ื™ ืœื ืื•ื”ื‘ ืืช ื”ืขื•ืœื')
68
+ [[{'label': 'natural', 'score': 9.214012970915064e-05},
69
+ {'label': 'possitive', 'score': 8.876807987689972e-05},
70
+ {'label': 'negetive', 'score': 0.9998190999031067}]]
71
  ```
72
+
73
  Our model is also available on AWS! for more information visit [AWS' git](https://github.com/aws-samples/aws-lambda-docker-serverless-inference/tree/main/hebert-sentiment-analysis-inference-docker-lambda)
74
 
75
 
 
83
  Chriqui, A., & Yahav, I. (2021). HeBERT & HebEMO: a Hebrew BERT Model and a Tool for Polarity Analysis and Emotion Recognition. arXiv preprint arXiv:2102.01909.
84
  ```
85
  @article{chriqui2021hebert,
86
+ title={HeBERT \\\\\\\\\\\\\\\\& HebEMO: a Hebrew BERT Model and a Tool for Polarity Analysis and Emotion Recognition},
87
  author={Chriqui, Avihay and Yahav, Inbal},
88
  journal={arXiv preprint arXiv:2102.01909},
89
  year={2021}