You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+35-15Lines changed: 35 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -189,7 +189,7 @@ SELECT pgml.transform(
189
189
Text classification involves assigning a label or category to a given text. Common use cases include sentiment analysis, natural language inference, and the assessment of grammatical correctness.
The default <ahref="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english"target="_blank">model</a> used for text classification is a fine-tuned version of DistilBERT-base-uncased that has been specifically optimized for the Stanford Sentiment Treebank dataset (sst2).
211
212
212
-
A fine-tune checkpoint of DistilBERT-base-uncased that is tuned on Stanford Sentiment Treebank(sst2) is used as a default <ahref="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english"target="_blank">model</a> for text classification.
213
213
214
-
*SQL query using specific model*
214
+
*Sentiment Analysis using specific model*
215
215
216
216
To use one of the over 19,000 models available on Hugging Face, include the name of the desired model and its associated task as a JSONB object in the SQL query. For example, if you want to use a RoBERTa <ahref="https://huggingface.co/models?pipeline_tag=text-classification"target="_blank">model</a> trained on around 40,000 English tweets and that has POS (positive), NEG (negative), and NEU (neutral) labels for its classes, include this information in the JSONB object when making your query.
217
217
@@ -236,7 +236,7 @@ SELECT pgml.transform(
236
236
]
237
237
```
238
238
239
-
*SQL query using models from specific industry*
239
+
*Sentiment analysis using industry specific model*
240
240
241
241
By selecting a model that has been specifically designed for a particular industry, you can achieve more accurate and relevant text classification. An example of such a model is <ahref="https://huggingface.co/ProsusAI/finbert"target="_blank">FinBERT</a>, a pre-trained NLP model that has been optimized for analyzing sentiment in financial text. FinBERT was created by training the BERT language model on a large financial corpus, and fine-tuning it to specifically classify financial sentiment. When using FinBERT, the model will provide softmax outputs for three different labels: positive, negative, or neutral.
242
242
@@ -262,17 +262,37 @@ SELECT pgml.transform(
262
262
{"label": "neutral", "score": 0.8062630891799927}
263
263
]
264
264
```
265
-
- Token Classification
266
-
- Table Question Answering
267
-
- Question Answering
268
-
- Zero-Shot Classification
269
-
- Translation
270
-
- Summarization
271
-
- Conversational
272
-
- Text Generation
273
-
- Text2Text Generation
274
-
- Fill-Mask
275
-
- Sentence Similarity
265
+
266
+
*Natural Language Infenrence (NLI)*
267
+
268
+
In NLI the model determines the relationship between two given texts. Concretely, the model takes a premise and a hypothesis and returns a class that can either be:
269
+
- entailment, which means the hypothesis is true.
270
+
- contraction, which means the hypothesis is false.
271
+
- neutral, which means there's no relation between the hypothesis and the premise.
272
+
273
+
The benchmark dataset for this task is GLUE (General Language Understanding Evaluation). NLI models have different variants, such as Multi-Genre NLI, Question NLI and Winograd NLI.
274
+
275
+
```sql
276
+
SELECTpgml.transform(
277
+
inputs => ARRAY[
278
+
'A soccer game with multiple males playing. Some men are playing a sport.'
0 commit comments