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
# or from a checkout:
pip install .

Package page: pypi.org/project/intent-score.

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)

Try it in your browser: prospy-io.github.io/intent-score. Everything runs locally in the page.

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.

Source and issues

The canonical repo is on Codeberg: codeberg.org/prospy/intent-score. It's mirrored to GitHub at github.com/prospy-io/intent-score. Issues and pull requests are welcome on either.

Development

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

License

MIT

Metadata

Release files for intent-score 0.1.1

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.1
File Size Uploaded Provenance
intent_score-0.1.1.tar.gz 11.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 20.8 kB

Release files / intent_score-0.1.1.tar.gz

Download URL intent_score-0.1.1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a7df57d5da580773b9057f3154b3ca9a9c5253648948b33588abc3408ea34bd7
BLAKE2b-256 checksum
How to use checksums
5d0b7a3b4cc09732c073fe9999a7b6f2fa08cc8b79075f10bc2f2bb52bee854b
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.1-py3-none-any.whl

Download URL intent_score-0.1.1-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e54c7d28bfadda43c980b6235a63f5ed1eb524c9fd9fdfe4d76e4198ef32010e
BLAKE2b-256 checksum
How to use checksums
e64a288bcf266e04fb4ceca05277264d6fb7464f409a5945a47545b37b8540e3
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.1

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.1 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