Commit
·
abb2507
1
Parent(s):
7fe102c
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- ja
|
| 4 |
+
license: mit
|
| 5 |
+
library_name: transformers
|
| 6 |
+
tags:
|
| 7 |
+
- fastText
|
| 8 |
+
pipeline_tag: zero-shot-classification
|
| 9 |
+
widget:
|
| 10 |
+
- text: "海賊王におれはなる"
|
| 11 |
+
candidate_labels: "海、山、陸"
|
| 12 |
+
multi_class: true
|
| 13 |
+
example_title: "ワンピース"
|
| 14 |
+
---
|
| 15 |
+
# fasttext-classification
|
| 16 |
+
fastText word vector base classifiction
|
| 17 |
+
## Reference
|
| 18 |
+
- fastText </br>
|
| 19 |
+
https://github.com/facebookresearch/fastText
|
| 20 |
+
- word vector data </br>
|
| 21 |
+
https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.ja.300.vec.gz
|
| 22 |
+
## Usage
|
| 23 |
+
Google Colaboratory Example
|
| 24 |
+
```
|
| 25 |
+
! apt install aptitude swig > /dev/null
|
| 26 |
+
! aptitude install mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file -y > /dev/null
|
| 27 |
+
! pip install transformers torch mecab-python3 torchtyping > /dev/null
|
| 28 |
+
! ln -s /etc/mecabrc /usr/local/etc/mecabrc
|
| 29 |
+
```
|
| 30 |
+
```
|
| 31 |
+
from transformers import pipeline
|
| 32 |
+
p = pipeline("zero-shot-classification", "paulhindemith/fasttext-classification", revision="2022.11.7", trust_remote_code=True)
|
| 33 |
+
```
|
| 34 |
+
```
|
| 35 |
+
p("海賊王におれはなる", candidate_labels=["海", "山", "陸"], hypothesis_template="{}", multi_label=True)
|
| 36 |
+
```
|