大規模な言語モデルから生成されたテキストの検出(GPT-2など)。
Webページ:http://gltr.io
オンラインデモ:http://gltr.io/dist/index.html
論文:https://arxiv.org/abs/1906.04043
Hendrik Strobelt、Sebastian Gehrmann、Alexander M. Rushによるプロジェクト。
MIT-IBM Watson AI LabとHarvardnlpのコラボレーション
Python> 3.6の依存関係をインストール:
pip install -r requirements.txt
gpt-2-small
のサーバーを実行:
python server.py
デモインスタンスは、http:// localhost:5001/client/index.htmlで実行されます
BERT
のサーバーを開始します:
python server.py --model BERT
インスタンスは現在、http:// localhost:5001/client/index.html?nodemoで実行されます。ヒント: gpt2-small
のデモテキストのみを提供しています。
usage: server.py [-h] [--model MODEL] [--nodebug NODEBUG] [--address ADDRESS]
[--port PORT] [--nocache NOCACHE] [--dir DIR] [--no_cors]
optional arguments:
-h, --help show this help message and exit
--model MODEL choose either 'gpt-2-small' (default) or 'BERT' or your own
--nodebug NODEBUG server in non-debugging mode
--port PORT port to launch UI and API (default:5001)
--no_cors launch API without CORS support (default: False)
バックエンドは、パラメーター--model NAME
で起動することでサーバーが呼び出すことができる多数のモデルAPIを定義します。カスタムモデルを追加するには、 backend/api.py
に独自のAPIを記述し、Decorator @register_api(name=NAME)
を追加する必要があります。
各APIは、 AbstractLanguageChecker
から継承するクラスである必要があります。これは、 check_probabilities
とpostprocess
2つの関数を定義しています。クラスと関数を実装するときは、 api.py
内のドキュメントに従ってください。
フロントエンドのソースコードはclient/src
にあります。
変更するには、ノード依存関係のインストールが必要です。
cd client/src ; npm install ; cd ../..
フロントエンドの再コンパイル:
> rm -rf client/dist ; cd client/src/ ; npm run build ; cd ../..
Apache 2
(c)2019年Hendrik Strobelt、Sebastian Gehrmann、Alexander M. Rush