Skip to main content

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.  

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.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wowool_quotes-2.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31ac8b8b0c51c6987b9e79895045c95e8fbdde35c51a817f3805274b61b6758f
MD5 40c9a88174e886d83f2d3c3d5adb8038
BLAKE2b-256 cf4c0f84da2b8c75cf6ca22f5494be582417942f35360063c578d18ed23c8e4b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.2 This release

1 file

2.1.1

1 file

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