Update README.md
Browse files
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 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
-
|
35 |
-
|
36 |
-
-
|
37 |
-
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
- **
|
49 |
-
- **
|
50 |
-
- **
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
<!--
|
77 |
-
|
78 |
-
|
79 |
-
*
|
80 |
-
-->
|
81 |
-
|
82 |
-
<!--
|
83 |
-
###
|
84 |
-
|
85 |
-
*
|
86 |
-
-->
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
##
|
101 |
-
|
102 |
-
###
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
<!--
|
129 |
-
##
|
130 |
-
|
131 |
-
*
|
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 |
-->
|