大規模な言語モデルから生成されたテキストの検出(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