SmartIU2 commited on
Commit
ac9f270
·
verified ·
1 Parent(s): f9c88fd

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +131 -143
README.md CHANGED
@@ -1,144 +1,132 @@
1
- ---
2
- tags:
3
- - setfit
4
- - absa
5
- - sentence-transformers
6
- - text-classification
7
- - generated_from_setfit_trainer
8
- widget: []
9
- metrics:
10
- - accuracy
11
- pipeline_tag: text-classification
12
- library_name: setfit
13
- inference: false
14
- ---
15
-
16
- # SetFit Aspect Model
17
-
18
- This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Aspect Based Sentiment Analysis (ABSA). A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification. In particular, this model is in charge of filtering aspect span candidates.
19
-
20
- The model has been trained using an efficient few-shot learning technique that involves:
21
-
22
- 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
23
- 2. Training a classification head with features from the fine-tuned Sentence Transformer.
24
-
25
- This model was trained within the context of a larger system for ABSA, which looks like so:
26
-
27
- 1. Use a spaCy model to select possible aspect span candidates.
28
- 2. **Use this SetFit model to filter these possible aspect span candidates.**
29
- 3. Use a SetFit model to classify the filtered aspect span candidates.
30
-
31
- ## Model Details
32
-
33
- ### Model Description
34
- - **Model Type:** SetFit
35
- <!-- - **Sentence Transformer:** [Unknown](https://huggingface.co/unknown) -->
36
- - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
37
- - **spaCy Model:** en_core_web_trf
38
- - **SetFitABSA Aspect Model:** [SmartIU2/setfit-imdb-absa-action-v1.0-aspect](https://huggingface.co/SmartIU2/setfit-imdb-absa-action-v1.0-aspect)
39
- - **SetFitABSA Polarity Model:** [SmartIU2/setfit-imdb-absa-action-v1.0-polarity](https://huggingface.co/SmartIU2/setfit-imdb-absa-action-v1.0-polarity)
40
- - **Maximum Sequence Length:** 512 tokens
41
- - **Number of Classes:** 2 classes
42
- <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
43
- <!-- - **Language:** Unknown -->
44
- <!-- - **License:** Unknown -->
45
-
46
- ### Model Sources
47
-
48
- - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
49
- - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
50
- - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
51
-
52
- ## Uses
53
-
54
- ### Direct Use for Inference
55
-
56
- First install the SetFit library:
57
-
58
- ```bash
59
- pip install setfit
60
- ```
61
-
62
- Then you can load this model and run inference.
63
-
64
- ```python
65
- from setfit import AbsaModel
66
-
67
- # Download from the 🤗 Hub
68
- model = AbsaModel.from_pretrained(
69
- "SmartIU2/setfit-imdb-absa-action-v1.0-aspect",
70
- "SmartIU2/setfit-imdb-absa-action-v1.0-polarity",
71
- )
72
- # Run inference
73
- preds = model("The food was great, but the venue is just way too busy.")
74
- ```
75
-
76
- <!--
77
- ### Downstream Use
78
-
79
- *List how someone could finetune this model on their own dataset.*
80
- -->
81
-
82
- <!--
83
- ### Out-of-Scope Use
84
-
85
- *List how the model may foreseeably be misused and address what users ought not to do with the model.*
86
- -->
87
-
88
- <!--
89
- ## Bias, Risks and Limitations
90
-
91
- *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
92
- -->
93
-
94
- <!--
95
- ### Recommendations
96
-
97
- *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
98
- -->
99
-
100
- ## Training Details
101
-
102
- ### Framework Versions
103
- - Python: 3.10.6
104
- - SetFit: 1.1.2
105
- - Sentence Transformers: 4.1.0
106
- - spaCy: 3.7.5
107
- - Transformers: 4.52.4
108
- - PyTorch: 2.7.0+cu128
109
- - Datasets: 3.6.0
110
- - Tokenizers: 0.21.1
111
-
112
- ## Citation
113
-
114
- ### BibTeX
115
- ```bibtex
116
- @article{https://doi.org/10.48550/arxiv.2209.11055,
117
- doi = {10.48550/ARXIV.2209.11055},
118
- url = {https://arxiv.org/abs/2209.11055},
119
- author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
120
- keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
121
- title = {Efficient Few-Shot Learning Without Prompts},
122
- publisher = {arXiv},
123
- year = {2022},
124
- copyright = {Creative Commons Attribution 4.0 International}
125
- }
126
- ```
127
-
128
- <!--
129
- ## Glossary
130
-
131
- *Clearly define terms in order to be accessible across audiences.*
132
- -->
133
-
134
- <!--
135
- ## Model Card Authors
136
-
137
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
138
- -->
139
-
140
- <!--
141
- ## Model Card Contact
142
-
143
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
144
  -->
 
1
+ ---
2
+ tags:
3
+ - setfit
4
+ - absa
5
+ - sentence-transformers
6
+ - text-classification
7
+ - generated_from_setfit_trainer
8
+ widget: []
9
+ metrics:
10
+ - accuracy
11
+ pipeline_tag: text-classification
12
+ library_name: setfit
13
+ inference: false
14
+ language:
15
+ - en
16
+ base_model:
17
+ - sentence-transformers/all-distilroberta-v1
18
+ ---
19
+
20
+ ## Usage
21
+
22
+ This model was created with a [Setfit Fork](https://github.com/smartIU2/setfit) using a custom aspect extractor.
23
+
24
+ It is intended to be used in conjunction with [IMDb_ABSA](https://github.com/smartIU2/imdb_absa) only.
25
+
26
+
27
+ Default setfit model card below:
28
+
29
+
30
+ # SetFit Aspect Model
31
+
32
+ A [SetFit](https://github.com/huggingface/setfit) model can be used for Aspect Based Sentiment Analysis (ABSA). A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification. In particular, this model is in charge of filtering aspect span candidates.
33
+
34
+ The model has been trained using an efficient few-shot learning technique that involves:
35
+
36
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
37
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
38
+
39
+ This model was trained within the context of a larger system for ABSA, which looks like so:
40
+
41
+ 1. Use a spaCy model to select possible aspect span candidates.
42
+ 2. **Use this SetFit model to filter these possible aspect span candidates.**
43
+ 3. Use a SetFit model to classify the filtered aspect span candidates.
44
+
45
+ ## Model Details
46
+
47
+ ### Model Description
48
+ - **Model Type:** SetFit
49
+ - **Sentence Transformer:** sentence-transformers/all-distilroberta-v1
50
+ - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
51
+ - **spaCy Model:** en_core_web_trf
52
+ - **SetFitABSA Aspect Model:** [SmartIU2/setfit-imdb-absa-action-v1.0-aspect](https://huggingface.co/SmartIU2/setfit-imdb-absa-action-v1.0-aspect)
53
+ - **SetFitABSA Polarity Model:** [SmartIU2/setfit-imdb-absa-action-v1.0-polarity](https://huggingface.co/SmartIU2/setfit-imdb-absa-action-v1.0-polarity)
54
+ - **Maximum Sequence Length:** 512 tokens
55
+ - **Number of Classes:** 2 classes
56
+ - **Language:** English
57
+
58
+ ### Original Setfit Model Sources
59
+
60
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
61
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
62
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
63
+
64
+ <!--
65
+ ### Downstream Use
66
+
67
+ *List how someone could finetune this model on their own dataset.*
68
+ -->
69
+
70
+ <!--
71
+ ### Out-of-Scope Use
72
+
73
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
74
+ -->
75
+
76
+ <!--
77
+ ## Bias, Risks and Limitations
78
+
79
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
80
+ -->
81
+
82
+ <!--
83
+ ### Recommendations
84
+
85
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
86
+ -->
87
+
88
+ ## Training Details
89
+
90
+ ### Framework Versions
91
+ - Python: 3.10.6
92
+ - SetFit: 1.1.2
93
+ - Sentence Transformers: 4.1.0
94
+ - spaCy: 3.7.5
95
+ - Transformers: 4.52.4
96
+ - PyTorch: 2.7.0+cu128
97
+ - Datasets: 3.6.0
98
+ - Tokenizers: 0.21.1
99
+
100
+ ## Citation
101
+
102
+ ### BibTeX
103
+ ```bibtex
104
+ @article{https://doi.org/10.48550/arxiv.2209.11055,
105
+ doi = {10.48550/ARXIV.2209.11055},
106
+ url = {https://arxiv.org/abs/2209.11055},
107
+ author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
108
+ keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
109
+ title = {Efficient Few-Shot Learning Without Prompts},
110
+ publisher = {arXiv},
111
+ year = {2022},
112
+ copyright = {Creative Commons Attribution 4.0 International}
113
+ }
114
+ ```
115
+
116
+ <!--
117
+ ## Glossary
118
+
119
+ *Clearly define terms in order to be accessible across audiences.*
120
+ -->
121
+
122
+ <!--
123
+ ## Model Card Authors
124
+
125
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
126
+ -->
127
+
128
+ <!--
129
+ ## Model Card Contact
130
+
131
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
 
 
 
 
 
 
 
 
 
 
 
 
132
  -->