Skip to main content

Production-grade NLP library for unified content intelligence.

Project description

contentintelpy

Production-grade NLP library for unified content intelligence.

contentintelpy provides a unified, DAG-based engine for multilingual sentiment analysis, NER, translation, and summarization using real transformer models (RoBERTa, GLiNER, NLLB).

Features

  • Real Models: No heuristics. Uses State-of-the-Art Transformers.
    • Sentiment: RoBERTa
    • NER: GLiNER
    • Translation: NLLB (GPU) + ArgosTranslate (Offline CPU)
  • Hybrid Execution: Models download on first run (lazy-loaded). Offline fallback available.
  • Deterministic Pipelines: DAG-based execution guarantees order.
  • Dual API:
    • Pipeline-first for complex workflows.
    • Service-first for quick scripts.
  • Production Ready: Thread-safe, standard error handling, sparse outputs.

Installation

Install the base library:

pip install contentintelpy

Optional Dependencies (Recommended)

Since the library uses heavy ML models, you should install the specific components you need:

# For all core features
pip install "contentintelpy[core,ner,translation,summarization]"

# For development
pip install "contentintelpy[dev]"

[!IMPORTANT] spaCy Model Requirement If you use NER or language features, you must install a spaCy model manually:

python -m spacy download en_core_web_sm

Quick Start

Ideal for simple tasks in notebooks or scripts.

from contentintelpy import SentimentService, TranslationService

# Sentiment
service = SentimentService()
result = service.analyze("This library is amazing!")
print(result) 
# {'value': 'positive', 'confidence': 0.99, ...}

# Translation
translator = TranslationService()
text = translator.translate("Hola mundo", target="en")
print(text)
# "Hello world"

Production Usage (Pipeline-First)

Recommended for Backends, APIs, and Data Pipelines.

import contentintelpy as ci

# 1. Create the canonical pipeline
pipeline = ci.create_default_pipeline()

# 2. Run it (Thread-safe)
result = pipeline.run({
    "text": "गूगल ने बेंगलुरु में नया कार्यालय खोला"
})

# 3. Access Sparse Output
print(result)

Output Example:

{
  "text": "...",
  "text_translated": "Google opened a new office in Bengaluru",
  "language": "hi",
  "entities": [
    {"text": "Google", "label": "ORG"},
    {"text": "Bengaluru", "label": "LOC"}
  ],
  "sentiment": {
    "value": "neutral",
    "value_en": "neutral",
    "confidence": 0.95
  },
  "summary": "..."
}

Error Handling

Nodes never crash the pipeline. Errors are collected in errors dict.

{
    "text": "...",
    "errors": {
        "TranslationNode": "Model download failed: Connection error"
    }
}

Architecture

This library is pure logic. It does NOT contain:

  • Flask / FastAPI routes
  • Database models
  • Authentication

It is designed to be consumed by your backend application.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

contentintelpy-0.1.1.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

contentintelpy-0.1.1-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file contentintelpy-0.1.1.tar.gz.

File metadata

  • Download URL: contentintelpy-0.1.1.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for contentintelpy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b2f550d015f6aa2d475e69fa9ebe00656a26dec28ec5cf324b8b90bbaaca2a52
MD5 a1afd6b17b720653eb3848e2a098bb90
BLAKE2b-256 492aa7620ae6c5cafa543b6fd52ad89dfdb2f2107b32f29405631dc369d27f51

See more details on using hashes here.

File details

Details for the file contentintelpy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: contentintelpy-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for contentintelpy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 47cad716fb72a99ea4d50da37e5b6ca826a5eaed767b6af8c9658aeb7742b069
MD5 dc4948a9be3ca9803a59c540403aaa84
BLAKE2b-256 f4207b164fda906c27bd81f3fa19720eb2d3b87bd8b73db19203f08af9e9aa39

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page