- 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 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.
I am going to update the code to work with Falcon, so you see the sequence diagram for Falcon.
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:
- Open this URL in your browser.
- Enter a 1000-word text, Submit and Right-click and select "Inspect" to open the developer tools.
- Click on the "Network" tab.
- Look for a POST request under the "Name" column in the list that appears. It should be related to "completions".
- Click on the POST request and find the "Authorization" section under the "Headers" tab.
- The bearer key is located in the "Authorization" section and it begins with the word "Bearer", as described in the image below.
ai_text_detector/
|--- ai_text_detector/
| |--- __init__.py
| |--- ai_detector.py
| |--- plotting.py
|--- setup.py
|--- TypeTruth_Collab_Notebook.ipynb
|--- README.md
|--- LICENSE.txt
Note: Please star this project if you find it useful.