File size: 1,430 Bytes
0bb74b8
cb79e25
 
d4418d8
cb79e25
 
 
 
 
 
 
 
 
0bb74b8
e4d1cae
 
 
9ab6f28
e4d1cae
 
 
2242279
 
 
 
 
 
bf2baa3
2242279
 
 
 
 
2b28047
 
2242279
2b28047
bf2baa3
1680e48
bf2baa3
 
 
 
 
2b28047
3104ae1
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
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
---
language: 
  - ja
license: cc-by-sa-3.0
library_name: transformers
tags:
- fastText
- embedding
pipeline_tag: feature-extraction
widget:
- text: "海賊王におれはなる"
  example_title: "ワンピース"

---


# fasttext-jp-embedding
**This model is experimental.**

Pretrained FastText word vector for Japanese

## Usage

Google Colaboratory Example
```
! apt install aptitude swig > /dev/null 
! aptitude install mecab libmecab-dev mecab-ipadic-utf8 git make curl xz-utils file -y > /dev/null 
! pip install transformers torch mecab-python3 torchtyping > /dev/null 
! ln -s /etc/mecabrc /usr/local/etc/mecabrc
```

```
from transformers import pipeline
import pandas as pd
import numpy as np 

text = "海賊王におれはなる"

pipeline = pipeline("feature-extraction", model="paulhindemith/fasttext-jp-embedding", revision="2022.11.13", trust_remote_code=True)
pd.DataFrame(np.array(pipeline(text)).T, columns=pipeline.tokenizer.tokenize(text))
```

```
pipeline.tokenizer.target_hinshi = ["動詞", "名詞", "形容詞"]
pd.DataFrame(np.array(pipeline(text)).T, columns=pipeline.tokenizer.tokenize(text))
```

## License
This model utilizes the folllowing pretrained vectors.
Name: fastText  
Credit: https://fasttext.cc/  
License: [Creative Commons Attribution-Share-Alike License 3.0](https://creativecommons.org/licenses/by-sa/3.0/)  
Link: https://dl.fbaipublicfiles.com/fasttext/vectors-wiki/wiki.ja.vec