|
--- |
|
tags: |
|
- sentence-transformers |
|
- feature-extraction |
|
- sentence-similarity |
|
- transformers |
|
datasets: |
|
- shunk031/jsnli |
|
license: cc-by-sa-4.0 |
|
language: |
|
- ja |
|
metrics: |
|
- spearmanr |
|
pipeline_tag: sentence-similarity |
|
library_name: generic |
|
--- |
|
|
|
## 目的 |
|
|
|
sentence-transformers の widget を日本語対応できないか実験しています。 |
|
generic library を実行するために public repo にしています。 |
|
|
|
README.md, pipeline.py, requirements.txt 以外のファイルは [cl-nagoya/sup-simcse-ja-base](https://huggingface.co/cl-nagoya/sup-simcse-ja-base) (CC BY-SA 4.0) のコピーです。 |
|
|
|
## 結果 |
|
|
|
以下の設定をすると日本語でも Sentense Similarity の Widget が実行可能になりました。 |
|
|
|
- [README.md](https://huggingface.co/yuji96/ja-support-for-inference-api/blob/main/README.md): `pipeline_tag: sentence-similarity, library_name: generic` を指定 |
|
- [pipeline.py](https://huggingface.co/yuji96/ja-support-for-inference-api/blob/main/pipeline.py): 本家の [pipelines/sentence_similarity.py](https://github.com/huggingface/api-inference-community/blob/main/docker_images/sentence_transformers/app/pipelines/sentence_similarity.py) のほぼコピペ |
|
- [requirements.txt](https://huggingface.co/yuji96/ja-support-for-inference-api/blob/main/requirements.txt): `sentense-transformer` に加えて `fugashi[unidic-lite] |
|
` などの追加ライブラリを指定 |
|
|
|
> language tag が Japanese のときだけ裏側で `pip install transformer[ja]` をしてもらうのが最善に感じますが、contribute できそうな repository が見当たりませんでした。 |
|
|