Skip to main content

Extract causal relation sentences from macroeconomic news articles

Project description

macroextract

Extract causal relation sentences from macroeconomic news articles.

Installation

pip install macroextract
python -m spacy download en_core_web_md

Usage

CLI

# Extract relations from test articles
macro bench extract_all

# Verbose output with sentences
macro bench extract_all -v

# Filter by filename pattern
macro bench extract_all "bbc*"

# Debug sentence structure
macro debug sentence "Inflation rose due to supply constraints."

Python API

import macroextract

results = macroextract.extract(article_text)

for r in results:
    print(r["sentence"])
    print(r["time"])
    print(r["place"])

Output Format

sentence: "Tobacco prices grew largely due to duty rises announced in the Budget."
time:     November
place:    (none)

Causal Markers

The extractor identifies sentences containing causal language:

  • Connectors: because, due to, after, following, amid
  • Verbs: cause, trigger, fuel, drive, support, spark, spur, dampen, contribute, push
  • Nouns: contributor, driver, factor, catalyst, impact

License

MIT

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

macroextract-0.1.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

macroextract-0.1.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file macroextract-0.1.0.tar.gz.

File metadata

  • Download URL: macroextract-0.1.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for macroextract-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3151774b83b2c591db89f2daa7375343beecf4c329c7d74c71cffabf28d59845
MD5 48cac6e7336db620f7ba9b25bb709700
BLAKE2b-256 6cf399ef6e21dd66b8795a82cacd03b6c5190342d3a2ecc91442ce02194b5fcc

See more details on using hashes here.

File details

Details for the file macroextract-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: macroextract-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for macroextract-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 531921ae1983d1e0588a41007f48a225345acd588be9bceb655b17c7de307498
MD5 af2d52fb8ebd0bfd66d120b74089f9ea
BLAKE2b-256 772bc8439e991fcc496e510894d8983a447d537ad6f45a08585f0be464e2d634

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