ONNX Model Zoo

madhavgohel/bert-token-onnx

By madhavgohel · ↓ 15 · ♥ 0 · Updated 2025-12-03

What's in this repo

This page lists the files in madhavgohel/bert-token-onnx, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 13 files, including 4 .json, 3 .py, 2 .txt, 1 .md, 1 .onnx, 1 .safetensors
  • Last updated 2025-12-03

ONNX files

File Size Download
model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

🧠 IntextIQ: Intext Intelligence – Smart Way to Find What Matters


📖 Overview

IntextIQ is an intelligent token extraction and memory-augmented reasoning framework designed to enhance Large Language Models (LLMs) in long-context dialogue scenarios.
The system identifies and retains semantically important tokens from user inputs, stores them efficiently, and retrieves them through a Retrieval-Augmented Generation (RAG) pipeline for improved contextual understanding and factual consistency.

This approach enables LLMs to “remember what matters” — maintaining coherent, factual, and contextually aware conversations even across extended interactions.


🚀 Key Features

  • Token-Level Semantic Extraction
    Extracts meaningful tokens using a fine-tuned DistilBERT model trained on conversational data generated via Mistral-22B and GPT-OSS-20B.

  • Memory-Augmented RAG Integration
    Seamlessly integrates token retrieval with the RAG framework to provide explicit contextual memory for LLMs.

  • Groq LLM Integration
    Combines Groq’s high-speed inference with IntextIQ’s semantic memory to generate more factual and contextually relevant responses.

  • BIO Tagging for Token Labeling
    Implements BIO (Begin–Inside–Outside) tagging for accurate semantic segmentation of text sequences.

  • Interactive Gradio Interface
    User-friendly interface for inputting text, viewing extracted tokens, and visualizing RAG-based response generation.


🧩 System Architecture

The overall architecture consists of six major components:

  1. Input Message – Raw user input.
  2. IntextIQ Model (Token Extractor) – Extracts key tokens using fine-tuned DistilBERT.
  3. Embedding Model – Converts tokens into high-dimensional semantic vectors.
  4. RAG System – Retrieves relevant context from memory or external data sources.
  5. LLM – Generates enhanced output using the augmented context.
  6. Output Layer – Returns factually grounded and contextually coherent responses.

⚙️ Tech Stack

Component Technology
Token Extraction DistilBERT (fine-tuned)
Data Generation Mistral-22B, GPT-OSS-20B
Embeddings Safetensors
Integration Retrieval-Augmented Generation (RAG)
Front-End Gradio
LLM Engine OLLAMA
Environment Python 3.10+, PyTorch, Transformers, FAISS

📊 Dataset Information

Two datasets were generated using synthetic conversational data representing average human dialogue:

Dataset Model Rows Generation Time Quality
Dataset-1 Mistral-22B 5,000 24.5 hours Moderate
Dataset-2 GPT-OSS-20B 10,000 50 hours High (97% usable)

The second dataset was used for fine-tuning due to improved data quality and contextual diversity.


🧠 Model Workflow

  1. Preprocessing
    Text cleaning, normalization, and BIO tagging.
  2. Token Extraction
    Fine-tuned DistilBERT identifies important tokens.
  3. Embedding Generation
    Each token converted into a Safetensor embedding vector.
  4. RAG Integration
    Retrieved token embeddings are supplied to the Groq LLM during response generation.
  5. Response Generation
    LLM generates enhanced, contextually grounded answers.
  6. Visualization
    Gradio interface displays extracted tokens and RAG outputs.

🧪 Evaluation Metrics

Metric Groq (Baseline) IntextIQ (Proposed) Improvement
Context Relevance (%) 72.3 91.4 +26.4%
Factual Consistency (%) 68.1 89.7 +21.6%
Semantic Coherence (ROUGE-L) 0.61 0.79 +13%
Hallucination Rate (%) 17.8 5.9 ↓66%

Key Results:
IntextIQ achieves substantial improvement in factual grounding and context continuity, confirming the efficacy of token-level retrieval in RAG-based dialogue systems.


🔍 Performance Summary

  • 26.4% improvement in Context Relevance
  • 21.6% increase in Factual Consistency
  • 13% boost in Semantic Coherence (ROUGE-L)
  • 66% reduction in Hallucination Rate

These metrics validate that the semantic compression and retrieval approach improves LLM accuracy, coherence, and contextual reasoning in extended dialogues.


📈 Future Extensions

  • Incorporate RLHF (Reinforcement Learning with Human Feedback) for adaptive token weighting.
  • Extend memory to persistent multi-session knowledge graphs.
  • Develop domain-specific variants (e.g., legal, educational, healthcare).
  • Explore multimodal token extraction for images and voice data.
  • Deploy optimized versions using quantization or distillation for edge inference.

Model info

onnx safetensors bert region:us
↓ 15 ♥ 0

Created: 2025-08-01

Updated: 2025-12-03

View on Hugging Face

Files (13)

.gitattributes
README.md
app.py
config.json
intextiq.py
llm_integrate.py
model.onnx ONNX
model.safetensors
requirements.txt
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt

Related models