Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 1.7.0 instead.
Reason given by maintainers: half-published version

Geneea NLP Client SDK

A Python SDK for the Geneea Interpretor - a Natural Language Processing REST API that extracts linguistic insights from text documents.

Features

The SDK provides access to Geneea's NLP capabilities including language detection, named entity recognition (persons, organizations, locations), semantic tagging, sentiment analysis, and relationship extraction between entities.

Installation

pip install geneea-nlp-client

Supports Python 3.8 - 3.13.

Quick Start

from geneeanlpclient import g3

# Create a request builder with desired analyses
builder = g3.Request.Builder(
    analyses=[g3.AnalysisType.ENTITIES, g3.AnalysisType.SENTIMENT]
)

# Analyze text using the API client
with g3.Client.create(userKey="YOUR_API_KEY") as client:
    analysis = client.analyze(builder.build(
        id="doc1",
        text="Angela Merkel visited Paris last Tuesday."
    ))
    
    # Access results
    for entity in analysis.entities:
        print(f"{entity.type}: {entity.stdForm}")
    
    if analysis.docSentiment:
        print(f"Sentiment: {analysis.docSentiment.label}")

You can also set the API key via the GENEEA_API_KEY environment variable.

Analysis Types

Type Description
ENTITIES Named entity recognition
TAGS Semantic tagging and topic extraction
RELATIONS Entity relationships and attributes
SENTIMENT Sentiment analysis
LANGUAGE Language detection
ALL All analyses

Advanced Usage

Structured document input:

builder = g3.Request.Builder(analyses=[g3.AnalysisType.ALL])
request = builder.build(
    id="article1",
    paraSpecs=[
        g3.ParaSpec.title("Author Elena Marsh Releases New Historical Novel"),
        g3.ParaSpec.lead("The acclaimed writer returns with a story set in 19th century Prague."),
        g3.ParaSpec.body("First paragraph of the article."),
        g3.ParaSpec.body("Second paragraph of the article.")
    ]
)

Note: The Interpretor (General API) can accept any number of paragraphs, but always returns at most one of each type: title, lead, and body. For title and lead this is usually not a limitation (there is typically only one of each), but if there are multiple body paragraphs in the input, they are concatenated into a single body paragraph with "\n\n" as separator in the output.

Domain-specific analysis:

builder = g3.Request.Builder(
    analyses=[g3.AnalysisType.ENTITIES, g3.AnalysisType.TAGS],
    domain=g3.Domain.NEWS,  # News media articles
    language=g3.LanguageCode.EN
)

With item-level sentiment and mentions:

builder = g3.Request.Builder(
    analyses=[g3.AnalysisType.ENTITIES, g3.AnalysisType.SENTIMENT],
    returnMentions=True,
    returnItemSentiment=True
)

Working with results:

# Iterate through document structure
for paragraph in analysis.paragraphs:
    print(f"Paragraph type: {paragraph.type}")
    for sentence in paragraph.sentences:
        print(f"  Sentence: {sentence.text}")
        print(f"  First word: {sentence.tokens[0].text}")

# Entity mentions with positions
for entity in analysis.entities:
    for mention in entity.mentions:
        print(f"{entity.stdForm} found at: {mention.tokens.charSpan}")

Dependencies

  • requests~=2.25 - HTTP communication
  • pandas>=0.22 (optional) - For example scripts with Excel export

Development

The SDK is built using Bitbucket Pipelines. The pipelines are run at least once a month to keep the SonarQube token valid.

Documentation

License

Apache License 2.0

Release files for geneea-nlp-client 1.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for geneea-nlp-client 1.6.0
File Interpreter ABI Platform
geneea_nlp_client-1.6.0-py3-none-any.whl Python 3 none any Details

Release files / geneea_nlp_client-1.6.0-py3-none-any.whl

Download URL geneea_nlp_client-1.6.0-py3-none-any.whl
Size 72.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02cb5222f99aefac2be3cf82454d537765aef9c1e27064267609d8d30b6839a7
BLAKE2b-256 checksum
How to use checksums
0efb3ddfddb3c968dd9d749779b8a21b3a0e8cab952b7f13b12079f1b696aa1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.19

Release history Release notifications | RSS feed

1.7.0

2 release files

This release

1.6.0 This release

1 release file

1.5.2

1 release file

1.5.1

2 release files

1.5.0

2 release files

1.4.4

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page