How javazeroo/bilibili_senior_llm works
Main Components
• Screen Capture & OCR Module – Likely handled by components in cap.py.
• Language Model Integration – This logic is implemented inside llm.py, which contains the get_ans function that interacts with the GPT-4 API or similar.
• Main Control & Automation Module – Located in main.py; this file serves as the central orchestrator that triggers the screen capture, passes the recognized text for processing, and then simulates mouse clicks.
• External Dependencies – These include PaddleOCR for text recognition, pyautogui for screen capture and mouse simulation, and possibly PaddlePaddle as the underlying deep learning framework.
Interactions and Data Flow
• The process begins with the main control module (main.py) which initiates a screen capture (possibly by calling functions in cap.py).
• The captured screenshot is processed with PaddleOCR to extract text, where:
• The recognized text (extracted question content and answer options) is sent to the language model layer (llm.py). Here, the get_ans function calls the GPT-4 API to determine the correct answer.
• Once the answer is generated, main.py uses pyautogui to simulate a mouse click at the corresponding on-screen button or area.
Architectural Patterns & Design Principles
• Separation of Concerns – Each Python file (cap.py, llm.py, main.py) is dedicated to a specific task: capturing/processing screenshots, interfacing with the language model, and coordinating the actions.
• Modularity – Using separate modules allows for easy testing and future enhancements. For example, if the OCR method or language model API needs to be updated, it can be done in isolation.