큰 언어 모델 (예 : GPT-2)에서 생성 된 텍스트 감지.
웹 페이지 : http://gltr.io
online-demo : 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
정의합니다. 클래스와 기능을 구현할 때 api.py
내 문서를 따르십시오.
프론트 엔드의 소스 코드는 client/src
에 있습니다.
수정하려면 노드 종속성 설치가 필요합니다.
cd client/src ; npm install ; cd ../..
프론트 엔드의 재 컴파일 :
> rm -rf client/dist ; cd client/src/ ; npm run build ; cd ../..
아파치 2
(c) 2019 년 Hendrik Strobelt, Sebastian Gehrmann, Alexander M. Rush