跳到正文
DEV Community· Shah Murad Ali·· 4 天前AI 評分35

Notice2Action AI:以 Google Gemini 和 Python 將大學通知轉化為可執行任務

Notice2Action AI: Turning University Notices into Actionable Tasks with Google Gemini and Python

AI 導讀

Notice2Action AI 是一款以 Python 開發的網頁應用程式,透過 Google Gemini API 分析大學通知,整理出摘要、限期、要求及可執行任務。用戶可上載 PDF 或圖片,並在 AI 分析前編輯擷取的文字;應用程式亦提供通知資料庫及任務與限期管理功能。

正文

Universities generate a continuous stream of announcements, circulars, notifications, and administrative documents.

These notices often contain important information about registration deadlines, examination schedules, scholarship opportunities, eligibility criteria, required documents, application procedures, and departmental instructions.

However, important details can easily get buried inside lengthy documents.

Students may overlook deadlines, misunderstand eligibility requirements, or forget the steps they need to complete.

I wanted to explore how generative AI could help solve this everyday information-management problem.

That idea became Notice2Action AI — an AI-powered application that transforms university notices into structured summaries, deadlines, requirements, and actionable tasks.

Instead of simply summarizing a document, the goal is to help users understand what matters and what they need to do next.

1. The Problem

Imagine receiving a university notification containing several pages of information.

You need to identify:

  • What is this notice about?
  • Who is eligible?
  • What is the deadline?
  • Which documents are required?
  • Where should the application be submitted?
  • What actions should be completed?
  • Are there any important instructions or contact details?

Finding these details manually can be time-consuming, especially when multiple notices arrive from different departments.

A conventional document viewer does not automatically organize this information into a useful task-management workflow.

This is the problem Notice2Action AI aims to address.

2. Introducing Notice2Action AI

Notice2Action AI is a Python-based web application that uses Google's Gemini API to analyze university notices and extract relevant information.

Users can upload PDF documents or images. The application processes the document, extracts its text, and sends the available content for AI-powered analysis.

The resulting information is organized into structured sections, including:

  • Notice summaries.
  • Important dates and deadlines.
  • Eligibility criteria.
  • Required documents.
  • Departments, venues, and contact information.
  • Instructions and important details.
  • Actionable tasks.

Users can review and edit extracted text before analysis, helping them correct OCR errors or improve the information provided to the AI.

The application also includes a notice library and a task and deadline management workflow.

Live Application: (https://notice2action-ai.streamlit.app/)

GitHub Repository: (https://github.com/alpha5-rdx/Notice2Action-AI)

3. Key Features

*PDF and Image Upload
*

Users can upload university notices in PDF or image formats.

The application supports document processing through PyMuPDF and image-based text extraction through Tesseract OCR.

This makes the application useful for both digitally generated documents and scanned notices.

*AI-Powered Notice Analysis
*

Google Gemini is used to interpret extracted document text and identify relevant information.

Rather than returning only a generic summary, the application organizes the analysis into useful categories.

For example, a scholarship announcement can be analyzed to identify its eligibility requirements, application deadline, supporting documents, and required actions.

*Editable Extracted Text
*

Document extraction is not always perfect.

Scanned documents may contain unclear text, unusual formatting, or OCR errors.

To account for this, Notice2Action AI provides an opportunity to review and edit extracted text before proceeding with AI analysis.

This human-in-the-loop approach helps users correct source text rather than blindly relying on the initial extraction.

*Important Dates and Deadlines
*

The application identifies important dates and deadlines mentioned in notices.

These are organized so users can review upcoming requirements and avoid overlooking important dates.

*Eligibility and Required Documents
*

University announcements often include specific eligibility conditions and documentation requirements.

Notice2Action AI extracts these details into structured sections, making them easier to understand and review.

*Actionable Task Extraction
*

One of the most useful features is converting notice information into actionable tasks.

Instead of leaving users with a paragraph of instructions, the application identifies things they may need to do.

*For example:
*

  • Complete an application form.
  • Prepare the required documents.
  • Submit the application to the relevant department.
  • Complete registration before the deadline.

Tasks can then be managed through the application's task-management section.

*Notice Library
*

Analyzed notices can be saved and revisited through the My Notices section.

Users can filter and manage their saved notices rather than repeatedly uploading the same documents.

*Tasks and Deadlines Dashboard
*

The application provides a dedicated area for reviewing extracted tasks and deadlines, including their status.

This connects document understanding with practical follow-up and task management.

*Configuration and Application Protection
*

The application includes password-based access protection and configurable settings.

Sensitive credentials are managed through environment variables or Streamlit Secrets rather than being embedded in the source code.

4. Technology Stack

The project brings together generative AI, document processing, OCR, database engineering, and cloud deployment.

  1. Python: Core application logic
  2. Streamlit: Web application interface
  3. Google Gemini API: AI-powered document analysis
  4. Google-GenAI: Gemini API integration
  5. PyMuPDF: PDF text extraction
  6. Tesseract OCR: Text extraction from scanned images
  7. Pillow: Image processing
  8. Pandas: Structured data handling/
  9. Supabase PostgreSQL: Primary cloud database
  10. SQLite: Local development fallback
  11. psycopg: PostgreSQL connectivity
  12. Git and Github: Version control
  13. Streamlit Community Cloud: Application deployment

5. How the Application Works

The application follows a document-processing and AI-analysis workflow.

*Step 1: Upload a notice
*

The user uploads a university notice as a PDF or image.

*Step 2: Extract document text
*

For PDFs, PyMuPDF extracts available text.

For scanned or image-based content, Tesseract OCR is used to recognize text.

*Step 3: Review extracted content
*

The extracted text is presented to the user for review and editing.

This step is important because document extraction can sometimes produce incomplete or incorrect text.

*Step 4: Analyze with Gemini
*

The application sends the prepared text to the configured Google Gemini model.

Gemini analyzes the content and identifies relevant information, including summaries, deadlines, eligibility criteria, required documents, and instructions.

*Step 5: Organize the results
*

The extracted information is presented in structured sections so users can understand the notice without manually searching through the entire document.

*Step 6: Save notices and manage tasks
*

The analyzed notice and associated information can be saved to the database.

Users can revisit notices, review deadlines, and manage their action items through the application's interface.

6. Database Architecture: Moving Beyond Local Storage

An important engineering decision during this project was moving from a local SQLite-based storage approach to Supabase PostgreSQL as the primary database.

The application uses three core database tables:

• notices: Stores analyzed notice information.
• deadlines: Stores important dates extracted from notices.
• action_items: Stores tasks generated from notice analysis.

The application uses PostgreSQL for the deployed environment, while SQLite remains available as a local development fallback when a PostgreSQL connection is not configured.

The database configuration is designed to make the deployment behavior explicit: when PostgreSQL is configured but the connection fails, the application reports the connection problem rather than silently switching to a different database.

This was an important lesson in designing reliable applications. A successful database connection should not be assumed simply because the application interface loads.

7. Engineering Challenges and Lessons Learned

Building Notice2Action AI involved more than integrating a generative AI API.

Some of the most valuable engineering challenges included:

*Handling Different Document Formats
*

PDFs and scanned images require different extraction approaches.

Combining PyMuPDF with Tesseract OCR allowed the application to handle both digitally generated and image-based notices.

*Managing AI Output
*

Generative AI can interpret complex instructions, but extracted information still needs to be organized and reviewed.

A structured analysis workflow and editable extracted text help make the application more practical.

*Database Migration
*

Moving from SQLite to Supabase PostgreSQL required changes to database connectivity, schema management, configuration, and testing.

It also required separating local development behavior from deployed cloud behavior.

*Secure Configuration
*

API keys, database connection strings, and application passwords should never be committed to a public repository.

The project uses Streamlit Secrets and environment-based configuration to keep sensitive information outside the source code.

*Testing and Reliability
*

The development process included automated tests covering application behavior, document processing, AI-related logic, database operations, authentication, and connection diagnostics.

Testing was especially important after introducing PostgreSQL because database behavior needed to be verified independently of the user interface.

8. Current Scope and Future Improvements

Notice2Action AI is a working project, but there is still room to expand its capabilities.

Some potential future improvements include:

  • Calendar integration for extracted deadlines.
  • Email or notification reminders before important dates.
  • Multi-user accounts and personalized notice libraries.
  • Support for additional document languages.
  • Improved OCR for low-quality scanned documents.
  • More advanced extraction validation and confidence indicators.
  • Duplicate notice detection.
  • Integration with university information systems.

These improvements could make Notice2Action AI more useful as a centralized information and task-management assistant for students and university communities.

9. Try Notice2Action AI

The application is deployed and available online.

Live Application: (https://notice2action-ai.streamlit.app/)

GitHub Repository: (https://github.com/alpha5-rdx/Notice2Action-AI)

You can explore the application, review its source code, and follow its development.

Feedback, suggestions, and contributions are welcome.

Final Thoughts

Notice2Action AI was built around a simple idea:

*Important information should not remain buried inside documents. It should become something people can understand and act upon.
*

This project gave me practical experience with generative AI integration, prompt-driven information extraction, document processing, OCR, relational database design, PostgreSQL deployment, application security, and automated testing.

It also reinforced an important lesson: building a useful AI application is not just about connecting an API to a user interface. It requires thoughtful workflows, reliable data handling, validation, and an understanding of the actual problem being solved.

I'm excited to continue improving Notice2Action AI and exploring more ways to turn AI capabilities into practical software solutions.

Thanks for reading!

來源:DEV Community · dev.to