GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Wahiba-Labrini/intelligent-requirements-assistant: AI-powered assistant that reads "cahier de charge" (DOC/PDF) and instantly extracts targets,technical requirements,deadlines,budget and risky sentences

BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
analysis
analysis
 
 
backend
backend
 
 
frontend
frontend
 
 
screenshots
screenshots
 
 
.gitignore
.gitignore
 
 
readme.md
readme.md
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

šŸ“‹ Intelligent Requirements Assistant

An intelligent assistant that analyzes cahier de charge documents (DOC / PDF) and extracts structured information to make specification documents effortless to read for developers.

Python FastAPI spaCy SQLite


šŸ“– About the Project

Developers often waste hours reading long, unstructured cahiers de charge (specification documents) just to find key information: objectives, deadlines, budgets, and technical constraints.

Intelligent Requirements Assistant automates this process. Upload a DOC or PDF file, and the assistant instantly extracts and displays a clean, structured summary of everything that matters.


🌟 Features

Feature Description
šŸ“„ Multi-format parsing Supports .docx and .pdf files
šŸŽÆ Targets extraction Detects project goals and objectives
āš™ļø Technical Requirements Extracts technical constraints and specifications
šŸ“¤ Outputs identification Lists expected deliverables and outputs
šŸ“… Date detection Finds deadlines and important dates
šŸ’° Budget extraction Identifies budget mentions and amounts
🚩 Flagged sentences Highlights risky, ambiguous, or critical sentences
šŸ’¾ Persistence Analysis history stored in SQLite via SQLAlchemy
šŸ–„ļø Simple UI Lightweight frontend (HTML / CSS / JavaScript)

🧠 How It Works

ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”      ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”     ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│  DOC / PDF │ ────▶│  Text Extraction     │────▶│  NLP Analysis      │
│   upload   │      │  • python-docx       │     │  • RegEx patterns   │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜      │  • pdfplumber        │     │  • spaCy NER        │
                    ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜     ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                                                          │
                   ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”               │
                   │  SQLite (SQLAlchemy) ā”‚ā—€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜
                   │  analysis history    │     Structured JSON output
                   ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜              │
                                                         ā–¼
                                              ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
                                              │  Frontend dashboard │
                                              │  (HTML/CSS/JS)      │
                                              ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

  1. Upload — the user uploads a cahier de charge (.docx or .pdf).
  2. Extract — raw text is extracted with python-docx or pdfplumber.
  3. Analyze — a hybrid NLP pipeline combines RegEx patterns (dates, amounts, deadlines) with spaCy (sentence segmentation, entity recognition, keyword matching).
  4. Structure — results are returned as clean JSON: targets, technical requirements, outputs, dates, budget, flagged sentences.
  5. Store & Display — results are saved in SQLite and rendered in the frontend dashboard.

šŸ› ļø Tech Stack

  • Backend: Python, FastAPI
  • NLP: spaCy, RegEx
  • Document parsing: python-docx, pdfplumber
  • Database: SQLite with SQLAlchemy ORM
  • Frontend: HTML, CSS, JavaScript (no framework)

šŸ“ Project Structure

Assistant-intelligent/
|
|__analysis/
   |__analytique_nlp.py
   |__nlp_regex.py
   |__nlp_spacy.py
|    
│__ backend/
    |__api.py                   
    |__clarity_score.py
    |__database.py                
    |__models.py
    |__text_extraction.py  
|
|__frontend/
   |__index.html
   |__results.html
   |__style.css
   |__style-res.css
   |__script.js
   |__result.js
|
|__.gitignore
|__requirements.text


šŸš€ Getting Started

Prerequisites

  • Python 3.10+
  • pip

Installation

# 1. Clone the repository
git clone https://github.com/Wahiba-Labrini/intelligent-requirements-assistant.git
cd intelligent-requirements-assistant

# 2. Create & activate the virtual environment
python -m venv venv

# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Download the spaCy language model
python -m spacy download en_core_news_sm

Run the Application

1. Start the FastAPI backend:

bash uvicorn api:app --reload

The API will be available at: http://127.0.0.1:8000 Interactive docs (Swagger UI): http://127.0.0.1:8000/docs

2. Open the application:

Visit http://127.0.0.1:8000 — the frontend is served directly by FastAPI (no Live Server needed).


šŸ“ø Screenshots

Upload page score result
Upload Score
Analysis results Flagged sentences
Result Flagged

šŸ”® Future Progress (Roadmap)

  • šŸŒ Multi-language support (French, English, Arabic)
  • šŸ¤– LLM integration (OpenAI / Ollama) for deeper semantic analysis
  • šŸ“Š Comparison of multiple cahiers de charge side-by-side
  • šŸ“¤ Export analysis as PDF / Word reports
  • šŸ‘„ User authentication & role management
  • ā˜ļø Cloud deployment (Docker + hosting)
  • šŸ“ˆ Confidence scoring for extracted entities
  • šŸ” Advanced search & filtering over analysis history

šŸ“š Lessons Learned

  • Live Server + FastAPI = silent CORS failures: opening the frontend through Live Server (port 5500) while the API runs on 127.0.0.1:8000 caused PDF analysis requests to fail silently — no console errors, no visible feedback. The definitive fix: serve the frontend directly from FastAPI (StaticFiles) so both share the same origin — the CORS problem disappears entirely.

  • Silent failures are the hardest bugs: because the browser showed nothing in the console, a whole day was spent debugging the wrong layer. Lesson: always check the Network tab, not just the Console.

  • Always return (and verify) IDs end-to-end: the analyzer endpoint expected a document id, but the upload endpoint didn't return one — the frontend silently passed undefined. Fix: make /upload return {"id": doc.id} and verify it in the frontend before calling the analyzer.

  • Hybrid NLP > pure deep learning for this use case: combining targeted RegEx patterns with spaCy's linguistic models gave fast, explainable, and accurate extraction without heavy infrastructure.

  • PDF text extraction spacing is tricky: characters sometimes come out glued together (lesexigencestechniques). layout=True preserves page layout but does not guarantee inter-word spaces. The reliable fix is extracting words and joining them with spaces:

python
 words = page.extract_words(x_tolerance=1.5)
 text += " ".join(w["text"] for w in words)
  • Designing the database schema early (SQLAlchemy models) saved significant refactoring time when adding the analysis-history feature.

  • Fixed thresholds fail on real-world PDFs — proportional ones don't: one line in a cahier de charge kept extracting with glued words (runtimeandimprovetheoveralluserexperience) no matter what we tried — layout=True, x_tolerance=5, x_tolerance=3, even extract_words(). The gaps between words on that line were simply smaller than any fixed tolerance. The definitive fix was rebuilding each line from raw chars and inserting a space only when the gap exceeded 20% of the font size — a ratio that adapts to any document. Lesson: avoid magic numbers; make thresholds proportional to the data (font size, image width, etc.).

  • Writing precise RegEx patterns for dates and budget amounts taught us the importance of handling multiple formats (e.g. 12/05/2026, 12 mai 2026, 50 000 DH).


šŸ¤ Contributing

Contributions are welcome! Feel free to open an issue or submit a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

šŸ‘Øā€šŸ’» Authors

  • Wahiba Labrini — [https://github.com/Wahiba-Labrini]

Made with ā¤ļø to make developers' lives easier.

About

AI-powered assistant that reads "cahier de charge" (DOC/PDF) and instantly extracts targets,technical requirements,deadlines,budget and risky sentences

Topics

cssfastapfastapijavascriptnlppythonregexspacy

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.