{"id":19530397,"url":"https://github.com/obaskly/docai","last_synced_at":"2025-04-17T14:13:20.384Z","repository":{"id":152124410,"uuid":"625374197","full_name":"obaskly/Docai","owner":"obaskly","description":"GPT-3 based Question Answering System that reads text from PDF, DOCX, or TXT files and answers questions based on the content.","archived":false,"fork":false,"pushed_at":"2023-04-09T02:16:31.000Z","size":23,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T06:11:22.506Z","etag":null,"topics":["ai","chatbot","chatgpt","gpt","gui","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/obaskly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-08T23:04:37.000Z","updated_at":"2024-02-09T02:59:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"fbb1b0aa-7abb-46f3-97f1-9e792b0f2722","html_url":"https://github.com/obaskly/Docai","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FDocai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FDocai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FDocai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/obaskly%2FDocai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/obaskly","download_url":"https://codeload.github.com/obaskly/Docai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249347324,"owners_count":21255148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chatbot","chatgpt","gpt","gui","python"],"created_at":"2024-11-11T01:31:49.270Z","updated_at":"2025-04-17T14:13:20.352Z","avatar_url":"https://github.com/obaskly.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ch1 align=\"center\"\u003e\n  \u003cbr\u003e\n  \u003cimg src=\"https://img.freepik.com/free-vector/cute-artificial-intelligence-robot-isometric-icon_1284-63045.jpg\" width=\"200\"\u003e\n  \u003cbr\u003e\n  Docai\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eDocai is a GPT-3 based Question Answering System that can provide answers based on a PDF, DOCX, and TXT files. \u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/os-windows-blue.svg?maxAge=2592000\u0026amp;style=flat\"\n         \u003e\n  \u003c/a\u003e\n  \u003ca href=\"\"\u003e\u003cimg src=\"https://img.shields.io/badge/version-1.0-red.svg?maxAge=2592000\u0026amp;style=flat\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#key-features\"\u003eKey Features\u003c/a\u003e •\n  \u003ca href=\"#how-to-use\"\u003eHow To Use\u003c/a\u003e •\n  \u003ca href=\"#Requirements\"\u003eRequirements\u003c/a\u003e •\n  \u003ca href=\"#Copyright\"\u003eCopyright\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"\"\u003e\u003cimg src=\"https://i.giphy.com/media/HdjEnj3U6b6hGzcRsW/giphy.webp\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Key Features\n\n* File handling\n  - The script supports PDF, DOCX, and TXT files\n  - Read the content using the pdfplumber, docx, and built-in open() functions\n* GPT-3 integration\n  - The script uses the OpenAI GPT-3 model, specifically the `text-davinci-003` engine, to generate answers to questions.\n* Confidence scoring\n  - The script calculates confidence scores for the generated answers using log probabilities returned by the GPT-3 API.\n* Concurrency\n  - It uses the `concurrent.futures.ThreadPoolExecutor` to process questions concurrently, potentially speeding up the process.\n* Text preprocessing\n  - The script splits the input document into chunks to fit within GPT-3's token limit, and post-processes the answers to remove duplicate sentences.\n* Saving conversation history\n  - The script allows users to save the conversation history to a text file.\n* Caching\n  - The script uses `lru_cache` decorator to cache the answers generated by GPT-3. This way, if a user asks the same question again, the cached answer can be returned instead of making another API call.\n* Gui\n  - The script provides a friendly graphical user interface built using the tkinter library and `ttkthemes` allowing users to select a file, input a question, view the answer, and save the conversation history.\n\n## How To Use\n\n- Put you api key in line 45\n- Run the script\n- Select your file\n- Enter your question and click submit\n\nIt's as simple as that\n\n\u003e **Note**\n\u003e We will provide an executable version soon\n\n## Requirements\n\n`pip install openai pdfplumber python-docx`\n\n## Copyright\n\nAll rights reserved to Bropocalypse Team.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobaskly%2Fdocai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fobaskly%2Fdocai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fobaskly%2Fdocai/lists"}