Catalog PyPI
PACKAGE EXPLORERView in registry

advanced-text-processing

PyPI

A powerful Named Entity Recognition and Resolution library with semantic matching

canonicalizationentity-linkingentity-resolutionnamed-entity-recognitionnernlpsemantic-matchingtext-processingwikidatawordnet
Versions collected1
Direct dependencies30From release 0.2.1
Last observed20 Oct, 19:59 UTC

README

Version 0.2.1 documentation

Advanced Text Processing

PyPI version Python Versions License: MIT Code style: black

A powerful Named Entity Recognition (NER) and Entity Resolution library designed for complex text processing tasks. It combines state-of-the-art NLP models (spaCy, Transformers) with robust knowledge bases (Wikidata, WordNet) to provide accurate entity extraction, canonicalization, and semantic matching.

🚀 Features

  • Advanced Entity Resolution:
    • Mode A (Sequential): Fast, early-stopping pipeline for high-confidence matches.
    • Mode B (Parallel): Aggregates multiple signals (fuzzy, semantic, contextual) for difficult cases.
  • Semantic Matching: Maps inputs to canonical schemas using sentence embeddings (SentenceTransformers).
  • Alias Retrieval: Automatically fetches aliases from Wikidata and synonyms from WordNet.
  • Canonicalization:
    • Entities (e.g., "Apple" -> "Apple Inc.")
    • Relationships (e.g., "relies on" -> "depends_on")
    • Properties (e.g., "birth date" -> "date_of_birth")
  • Flexible Candidate Generation: Supports exact lookup, fulltext blocking, and ANN search (FAISS/hnswlib).

📦 Installation

pip install advanced-text-processing

After installation, download the required models:

# Download spaCy model
python -m spacy download en_core_web_lg

# Download NLTK data
python -c "import nltk; nltk.download('wordnet'); nltk.download('omw-1.4')"

See Installation Guide for detailed instructions.

⚡ Quick Start

Named Entity Recognition

from ner_lib import recognize_entities

text = "Apple Inc. was founded by Steve Jobs in Cupertino."
result = recognize_entities(text)

for entity in result['entities']:
    print(f"{entity['text']} ({entity['type']})")
# Output:
# Apple Inc. (ORG)
# Steve Jobs (PERSON)
# Cupertino (GPE)

Entity Canonicalization

from ner_lib import canonicalize_entity

# Canonicalize an entity mention
result = canonicalize_entity("apple inc", mode="progressive")
print(f"Canonical: {result['canonical_name']}")
print(f"Aliases: {result['aliases']}")
# Output: 
# Canonical: Apple Inc.
# Aliases: ['Apple', 'AAPL', 'Apple Computer', ...]

Relationship Canonicalization

from ner_lib import Config, canonicalize_relationship

# Configure semantic matching
config = Config()
config.semantic_matching.enabled = True
config.semantic_matching.canonical_relationships = ["depends_on", "created_by"]

# Canonicalize a relationship phrase
result = canonicalize_relationship("relies heavily on", config=config)
print(f"Canonical: {result['canonical_name']}")
# Output: Canonical: depends_on

📚 Documentation

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details on how to get started.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgements

This library stands on the shoulders of giants. We gratefully acknowledge the following open-source projects:

See ACKNOWLEDGEMENTS.md for the full list of dependencies and credits.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.125 Nov 202530

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
dadhichgaurav1/advanced-text-processing

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:59 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:027413bfcfd6c7de889be5484a7898a9c230c949ae4bfd5a89d7a277d76ac6d8