Skip to main content

intent-score

Score a social post 0–100 for buying intent with transparent, editable regex rules. There's also an optional LLM prompt template for posts the rules can't call.

$ intent-score "Is there a tool that finds people asking for a CRM on forums? Need one for my startup asap."
 75 high   Is there a tool that finds people asking for a CRM on forums? Need one for my startup asap.
           +25 asks whether a tool exists; +25 states a need; +10 business context; +10 urgency; +5 asks a question
  • Pure Python, no dependencies, no network calls.
  • Every point in a score comes with a reason, so you can see why a post scored the way it did.
  • Ships with a static, in-browser demo (space/) that uses the exact same rules.
  • The example posts in examples/ are made up. No real user posts are included.

Install

pip install intent-score     # once published
# or from a checkout:
pip install .

Usage

# Score text directly
intent-score "Can anyone recommend a simple invoicing app?"

# Score a JSON-lines file, keep only strong signals, emit JSON
intent-score --jsonl examples/sample_posts.jsonl --min 60 --json

# Plain text on stdin, one post per line
cat posts.txt | intent-score

# Combine with a watcher, e.g. hn-keyword-watch or bsky-keyword-watch
hn-keyword-watch "alternative to" --json | intent-score --jsonl - --field title,text --min 25

In Python:

from intent_score import score, IntentScorer, load_rules

r = score("Looking for an alternative to our help desk, budget is flexible")
print(r.score, r.label, r.reasons)   # 85 high ['+30 asks for a solution', ...]

custom = IntentScorer(load_rules("my_rules.json"))

How scoring works

src/intent_score/rules.json holds a list of {id, pattern, weight, reason} rules. Each rule that matches adds its weight once. Negative weights cover self-promotion, job posts, promo codes and "not looking for...". The total is clamped to 0–100 and labelled high (≥60), medium (≥25) or low. Copy the file and tune it for your niche with --rules my_rules.json.

Optional LLM step

intent-score never calls an LLM. If you want a second opinion on borderline posts, build a prompt and send it to whichever model you already use:

from intent_score import build_prompt, parse_llm_response

prompt = build_prompt(post_text, product="a social listening tool for agencies")
reply = my_llm(prompt)                 # your own client
print(parse_llm_response(reply))       # {'score': 82, 'label': 'high', 'reason': '...'}

Or print prompts from the CLI with intent-score --prompt "a CRM for agencies" "post text".

Static demo (Hugging Face Space ready)

space/ is a plain HTML/JS page (index.html, scorer.js, rules.js) with Space front-matter in space/README.md (sdk: static). Open space/index.html locally or upload the folder as a static Space. After you edit rules.json, run python scripts/build_space.py to regenerate space/rules.js. A test checks that the JS and Python scorers agree.

Limits

  • It matches English keywords. It won't catch sarcasm or context, and it doesn't know about other languages. Treat the score as a first filter, not a verdict.
  • The default weights were tuned on a small set of made-up examples. Check them against your own data.
  • When you score posts from a public platform, follow that platform's API terms and rate limits, and don't contact people in bulk based on a score.

If you'd rather not run this yourself, Prospy does social listening and AI lead generation across X/Twitter, Reddit, Bluesky and Hacker News, surfacing buying-intent posts.

Development

PYTHONPATH=src python -m unittest discover -s tests -v

License

MIT

Metadata

Release files for intent-score 0.1.0

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

Source distribution (sdist)

Source distribution for intent-score 0.1.0
File Size Uploaded Provenance
intent_score-0.1.0.tar.gz 11.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for intent-score 0.1.0
File Interpreter ABI Platform
intent_score-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / intent_score-0.1.0.tar.gz

Download URL intent_score-0.1.0.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f2fd8fcdaf961ebf21f09c57614ad6ccc631f3907950006a377b0080d8812e08
BLAKE2b-256 checksum
How to use checksums
9cef2a38699c756a0665fe6d210961b534b72bf9d23eda6fab0ae162953451dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / intent_score-0.1.0-py3-none-any.whl

Download URL intent_score-0.1.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ea6c76553343cfefd902eb6935d4fffa2d919937d14bdd8d9f6a179919f21d71
BLAKE2b-256 checksum
How to use checksums
d1cbb6e8d0fd03ef3cbab60bd974a453f5b0b8fc4f29bdcd7d7bc6853bd463a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for intent-score 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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