Skip to main content

No project description provided

Project description

reading-impact-model

Reading Impact Model for analyzing reading impact in online book reviews.

Usage

Basic usage of the English language impact model:

from reading_impact_model.matcher import Matcher
from reading_impact_model import model_loader

impact_model_en = model_loader(lang='en')
matcher_en = Matcher(impact_model_en, debug=False)

sent_en = 'The writing is beautiful.'

matches = matcher_en.match_rules(sentence=sent_en)

for match in matches:
    print(match.match_word)                  # 'beautiful'
    print(match.impact_term)                 # 'beautiful'
    print(match.impact_term_type)            # 'style'
    for condition_match in match.condition_matches:
        print(condition_match.match_word)     # 'writing'
        print(condition_match.condition_term) # 'writing'
        print(condition_match.condition_type) # 'style'

The matcher accepts sentences as string but also Spacy sent objects:

import spacy
from reading_impact_model.matcher import Matcher
from reading_impact_model import model_loader

impact_model = model_loader(lang='en')
matcher = Matcher(impact_model, debug=False)

nlp = spacy.load('en_core_news_lg')

sentence = 'The dialogue is full of witty banter.'

doc = nlp(sentence)
for sent in doc.sents:
    print(sent)
    matches = matcher.match_rules(sentence=sent)
    for match in matches:
        print(match.json)

Project details


Download files

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

Source Distribution

reading_impact_model-0.2.0.tar.gz (652.2 kB view details)

Uploaded Source

Built Distribution

reading_impact_model-0.2.0-py3-none-any.whl (575.9 kB view details)

Uploaded Python 3

File details

Details for the file reading_impact_model-0.2.0.tar.gz.

File metadata

  • Download URL: reading_impact_model-0.2.0.tar.gz
  • Upload date:
  • Size: 652.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.9

File hashes

Hashes for reading_impact_model-0.2.0.tar.gz
Algorithm Hash digest
SHA256 5bee37f38128e1e5a525bbc1a82589ce3fb337677395603b0f66424c7c3a581f
MD5 c918a35edd378f20fa7fdd9ec4aa9f2a
BLAKE2b-256 a50fe3bcffc349c642a2563c95134b7f9bbc3e2a0b574d4d5bbc628b7c157898

See more details on using hashes here.

Provenance

File details

Details for the file reading_impact_model-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for reading_impact_model-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0977e01086228f0577ea7605034487ede955b4c48eca4002086d3154759c1a82
MD5 2d27d8737af990365e51e97c1a4269da
BLAKE2b-256 46da95997b49cf09b86dcfebfd939e21bcdb626c4256352141c30c1858c63f0d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page