利用OpenAI GPT-2模型来确定一段文本是由人还是机器编写的。这个程序允许你输入一段文本,它将输出一个分数,表明文本是由人编写的可能性。

Alex Steiner 2cdf73cace Fix 4 days ago
.vscode 80262d599e Updates 1 week ago
__pycache__ 2cdf73cace Fix 4 days ago
static 61a7947e69 Load Button 1 week ago
templates 8e933c5c80 Finished 1 week ago
.DS_Store 1c4025254f Percentage 4 days ago
.gitattributes 80262d599e Updates 1 week ago
.gitignore 80262d599e Updates 1 week ago
README.md 19267b741f Update README.md 1 week ago
burstiness.py 87468b488f Burstiness API 4 days ago
evaluate.py ce5fccaed7 Fixes 4 days ago
main.py 0e85cb8a9a Fix 1 week ago
perplexity.py 7352135b5d Revert 4 days ago
run.sh 863b6b570e CSS 1 week ago
server.py 863b6b570e CSS 1 week ago
utils.py 2cdf73cace Fix 4 days ago

README.md

GPT-Zero

A recreation of the website gptzero.me which utilizes the OpenAI GPT-2 model to determine whether a piece of text was written by a human or a machine. This program allows you to input a piece of text and it will output a score indicating the likelihood that the text was written by a human.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

  • Python 3.6 or higher
  • The OpenAI library
  • NLPT (Natural Language Toolkit)
  • Flask (Web framework)

Installing

To install the necessary libraries, run the following command in your terminal:

pip install openai nltk flask

This command will install the OpenAI library, NLTK, and Flask. The OpenAI library is used to access the GPT-2 model and perform the text generation and scoring. NLTK is used for natural language processing tasks such as tokenization and stemming. Flask is used to create the web interface for the program.

Running the program

To run the program, simply type the following command in your terminal:

./run.sh

This will start the local server and the program can be accessed in your web browser at http://localhost:8080/

You can input a text in the text area and click on "Submit" button. The program will use the GPT-2 model to generate a similar text and compare the input text with the generated text, based on this it will output a score indicating the likelihood that the text was written by a human.

Built With

  • Python - Programming language
  • OpenAI - AI library
  • NLTK - Natural Language Toolkit
  • Flask - Web framework

Author

Acknowledgments

Additionally, please note that to run this model you need to have credentials to access OpenAI's GPT2 model. You can find more information on how to acquire credentials on the OpenAI website.