Skip to main content

The Wowool Quotes Package

Project description

Extracting quotes and their referenced entities

The quotes app extracts quotations, even when the quotes extend through several sentences of text.

The app performs a lookup when a QuotationScope entity is found, that encompasses the Quotation and the QuotationAuthor. You can find this in the quotation domain or you can make your own custom domain with this entity.

Options

QuotesOptions

interface QuotesOptions {
    mentions: string[];
}

with:

Property Description
mentions URIs of the entities that should be extracted, if present, from the identified quotes

Results

QuotesResults

type QuotesResults = QuoteResult[];

QuoteResult

interface QuoteResult {
    author: string;
    text: string;
    begin_offset: string;
    end_offset: string;
}

with

Property Description
mentions URIs of the entities that should be extracted, if present, from the identified quotes
author Quotation author
text Quotation text
begin_offset Begin offset within the document
end_offset End offset within the document

Examples

Quotes only

Quotes and mentioned entities

Extracting quotes and their referenced entities

The quotes app extracts quotations, even when the quotes extend through several sentences of text.

The app performs a lookup when a QuotationScope entity is found, that encompasses the Quotation and the QuotationAuthor. You can find this in the quotation domain or you can make your own custom domain with this entity.

Options

QuotesOptions

interface QuotesOptions {
    mentions: string[];
}

with:

Property Description
mentions URIs of the entities that should be extracted, if present, from the identified quotes

Results

QuotesResults

type QuotesResults = QuoteResult[];

QuoteResult

interface QuoteResult {
    author: string;
    text: string;
    begin_offset: string;
    end_offset: string;
}

with

Property Description
mentions URIs of the entities that should be extracted, if present, from the identified quotes
author Quotation author
text Quotation text
begin_offset Begin offset within the document
end_offset End offset within the document

API

Examples

You will need to install the english language module to run the sample. pip install wowool-english

Extracting sentiments

Note that in the results the sentiments have been resolved. For this to happen we need to add the entities in the pipeline.

from wowool.sdk import Pipeline
from wowool.quotes import Quotes

text = '"Wowool has cool technology", said John Smith.'
pipeline = Pipeline(
    [
        "english",
        "quotation",
        "quotes.app",
    ]
)
document = pipeline(text)
print(document.results(Quotes.ID))

results:

[
    {
        "text": "\"Wowool has cool technology\"",
        "begin_offset": 0,
        "end_offset": 28,
        "author": "John Smith"
    }
]

License

In both cases you will need to acquirer a license file at https://www.wowool.com

Non-Commercial

This library is licensed under the GNU AGPLv3 for non-commercial use.  
For commercial use, a separate license must be purchased.  

Commercial license Terms

1. Grants the right to use this library in proprietary software.  
2. Requires a valid license key  
3. Redistribution in SaaS requires a commercial license.  

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

wowool_quotes-2.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file wowool_quotes-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: wowool_quotes-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for wowool_quotes-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 21be588afe8ce82ba11a7d874ffd63af3da5859c17754e306ab1958dc1b4d523
MD5 105a014b094a9b9f092373daafa9b427
BLAKE2b-256 68ef21f1f68b54dc85b3826cddfd2e0346495afee1b813e6d383ad808c8ec868

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