Skip to main content

TextBlob Parser for Swarmauri.

Project description

Swarmauri Logo

PyPI - Downloads Hits PyPI - Python Version PyPI - License PyPI - swarmauri_parser_textblob


Swarmauri Parser TextBlob

TextBlob-backed parsers for Swarmauri that split text into sentences or extract noun phrases. Ships two components: TextBlobSentenceParser and TextBlobNounParser.

Features

  • Sentence parser returns a Document per sentence with metadata identifying the parser.
  • Noun phrase parser returns the original text plus metadata['noun_phrases'] containing the phrases discovered by TextBlob.
  • Auto-downloads required NLTK corpora (punkt_tab) during initialization.

Prerequisites

  • Python 3.10 or newer.
  • TextBlob and its NLTK dependencies (installed automatically).
  • Internet access on first run so NLTK can download tokenizer data (or pre-download via python -m textblob.download_corpora).

Installation

# pip
pip install swarmauri_parser_textblob

# poetry
poetry add swarmauri_parser_textblob

# uv (pyproject-based projects)
uv add swarmauri_parser_textblob

Sentence Parsing

from swarmauri_parser_textblob import TextBlobSentenceParser

parser = TextBlobSentenceParser()
text = "One more large chapula please. It should be extra spicy!"

sentences = parser.parse(text)
for doc in sentences:
    print(doc.content)

Noun Phrase Extraction

from swarmauri_parser_textblob import TextBlobNounParser

parser = TextBlobNounParser()
docs = parser.parse("One more large chapula please.")

for doc in docs:
    print(doc.content)
    print(doc.metadata["noun_phrases"])

Tips

  • TextBlob uses simple heuristics—it works well for general English text but may struggle with domain-specific jargon.
  • Download corpora once in CI/CD or container builds (python -m textblob.download_corpora) to avoid runtime downloads.
  • Combine sentence and noun parsers to build structured representations of documents before vectorization or downstream NLP tasks.

Want to help?

If you want to contribute to swarmauri-sdk, read up on our guidelines for contributing that will help you get started.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

swarmauri_parser_textblob-0.9.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

swarmauri_parser_textblob-0.9.0-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file swarmauri_parser_textblob-0.9.0.tar.gz.

File metadata

  • Download URL: swarmauri_parser_textblob-0.9.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_parser_textblob-0.9.0.tar.gz
Algorithm Hash digest
SHA256 9326255ad8e11b16b53eff04870a0135eb869cb74d90ab4e5cab6e1886ecc507
MD5 4318bb4613ba659a59d660dec5419c3f
BLAKE2b-256 6f0a75a0b9e320bd949ab669f6037152c62d21ff457d3f76ceb7cfb1931e85f4

See more details on using hashes here.

File details

Details for the file swarmauri_parser_textblob-0.9.0-py3-none-any.whl.

File metadata

  • Download URL: swarmauri_parser_textblob-0.9.0-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for swarmauri_parser_textblob-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6951768260fe4da9588955edb4869a0c3e46db1d928431eb0c7a637ab0a1a6b0
MD5 b72b7dd53c3ce1df8a2ad1d0e87ddb77
BLAKE2b-256 8ff69c04ad01a4b9d1b7c471248518b64dacf125c45fd5095e7eb146b8388969

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