Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/izuna385/bert-article-recommender-with-faiss

Article Recommender with fine-tuned BERT and faiss.
https://github.com/izuna385/bert-article-recommender-with-faiss

allennlp approximate-nearest-neighbor-search bert faiss fastapi natural-language-processing recommender-system

Last synced: about 1 month ago
JSON representation

Article Recommender with fine-tuned BERT and faiss.

Awesome Lists containing this project

README

        

# BERT-Article-Recommender-with-Faiss
* BERTとfaissを用いた記事推薦の実装

# モデル
![dummy](./img/model.png)

# 環境設定
```
$ conda create -n allennlp python=3.7
$ conda activate allennlp
$ pip install -r requirements.txt
$ download.sh
```

# 実験方法
$ `python3 main.py -num_epochs 10`

* 特にパラメータ調整は行っていない。dev acc. ~85%, test acc. ~83%.

# 記事推薦モデルの立ち上げ
```
$ python3 main.py -num_epochs 10
$ uvicorn api:app --reload --host 0.0.0.0 --port 8000
```

# 記事推薦モデルの構成

![test](./img/recommend.png)

# 参考
[https://qiita.com/izuna385/items/a004982f76256cab1b2d](https://qiita.com/izuna385/items/a004982f76256cab1b2d)

# その他
* faiss関連でエラーが起こる場合、faissを一度削除して以下を試して下さい。

`pip install faiss-cpu --no-cache`

(参考記事:https://github.com/facebookresearch/faiss/issues/821#issuecomment-573531694)