[toc]
包括两个主体功能,
-
chatpdf.py对应上传pdf文件和对话交互。
https://github.com/jrterven/chatpdf_api_interface.git
2.针对网安课程,使用api批量批改学生实验报告。
The chatpdf_api_interface
is a Python-based graphical user interface application designed to interact with ChatPDF, an API for analyzing and interacting with PDF documents. Developed by Juan Terven, this tool offers a convenient way to upload PDF files, analyze them using ChatPDF, and engage in a chat-based interaction to extract and understand content from the PDFs.
- Browse and select PDF files for analysis.
- Upload PDFs to ChatPDF using an API key.
- Chat-based interaction for analyzing and querying content from PDF documents.
- Display of conversation history.
- Export functionality for chat conversations.
- Clear data and reset functionality.
To run chatpdf_api_interface
, you need Python installed on your system. Clone this repository to your local machine and install the required dependencies:
git clone [repository URL]
cd chatpdf_api_interface
pip install -r requirements.txt
To start the application, run:
python chatpdf.py
- Browse and Select PDF: Use the 'Browse' button to select a PDF file for analysis.
- Analyze PDF: Click 'Analyze PDF' to upload the file to ChatPDF and begin analysis.
- Chat Interaction: Enter prompts in the provided text field and send them to interact with the analyzed PDF.
- Export Chat: You can export the chat history using the 'Export Chat' button.
- Clear All: This button clears all the data and resets the interface.
You need to set an environment variable CHAT_PDF_KEY
with your ChatPDF API key. This key is necessary for the application to interact with the ChatPDF service.
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to all contributors and users of the chatpdf_api_interface
. Your feedback and contributions are highly appreciated.
Feel free to modify this template according to your project's specifics and requirements. Remember to add any additional sections as needed, such as 'Contributing', 'Credits', or 'Changelog'.
每周报告的文件夹,内部均解压:
- 能够网络连接chatpdf.com网站
- 注册账号并且从my account得到Chatpdf_api_key
- 当文件数大于500需要准备多个Chatpdf_api_key。因为免费使用500 questions per mouth,
1.修改BATCH_SIZE(表示单次运行进行打分的学生数量)以适应数量,多次运行ChatPDFScore.py直到完全覆盖所有学生文件。
2.得到所有文件输出后运行combine_and_score.py
中功能,得到最终gpt分数。
ChatPDFScore.Student_work
中影响打分质量的核心Prompt:
你现在是一名网络安全实践课程的助教,请使用不变的评分标准为刚才的课程报告pdf进行打分,满分100分,并在回复中使用数字给出最后得分,并且不要出现其他分数,可以有一些评价打分依据。
utils.upload_chatpdf_file
:上传文件
utils.query_chatpdf
:上传prompt并获取回复
网路不稳定导致的上传失败则设置对应报告分数为-1