Skip to content

TypeTruth is a Python library that detects whether a text is written by a human or AI. Ideal for fact-checking and content validation in the age of AI content generators.

License

Notifications You must be signed in to change notification settings

bhaskatripathi/TypeTruth

Repository files navigation

Problem Statement:

  • Sophisticated language models like OpenAI's GPT series, Falcon etc have blurred the lines between human-written and AI-generated text.
  • Distinguishing between AI and human-generated content has become a complex task with crucial implications:
  • Information Validity: AI-generated text may not always offer accurate or reliable information.
  • Authenticity: Textual content is often used to gauge the knowledge, opinions, and expertise of its author. AI-generated content obscures such assessments.
  • Accountability: In contexts where content can have serious consequences (e.g., news articles, legal documents), it's vital to identify its origin.

TypeTruth

TypeTruth is a Python library that detects whether a text is written by a human or AI. Ideal for fact-checking and content validation in the age of AI content generators. It offers AI Content Detection at Paragraph Level as well as Sentence Level. The solution also provides visualizations to better understand the detection results, such as bar plots and heat maps.

Sample Output:

Open In Colab

Paragraph Level:

image

Sentence Level:

image

UML

I am going to update the code to work with Falcon, so you see the sequence diagram for Falcon.

UML Diagram

Free Usage using Bearer Key

Bearer Key

Either you can use your own OpenAI key or you can use a bearer key available for free. To obtain a bearer key, follow this procedure:

  1. Open this URL in your browser.
  2. Enter a 1000-word text, Submit and Right-click and select "Inspect" to open the developer tools.
  3. Click on the "Network" tab.
  4. Look for a POST request under the "Name" column in the list that appears. It should be related to "completions".
  5. Click on the POST request and find the "Authorization" section under the "Headers" tab.
  6. The bearer key is located in the "Authorization" section and it begins with the word "Bearer", as described in the image below. image

Directory Structure

ai_text_detector/
|--- ai_text_detector/
|    |--- __init__.py
|    |--- ai_detector.py
|    |--- plotting.py
|--- setup.py
|--- TypeTruth_Collab_Notebook.ipynb
|--- README.md
|--- LICENSE.txt

Star

Note: Please star this project if you find it useful.

Star History

Star History Chart

About

TypeTruth is a Python library that detects whether a text is written by a human or AI. Ideal for fact-checking and content validation in the age of AI content generators.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published