Implicature Intent
Detect implicit intent vs. tone in short conversational turns.
implicature-intent is a lightweight, zero-dependency Python library designed to separate what someone means (Intent) from how they say it (Tone). It is deterministic, explainable, and fast.
Why Intent ≠ Sentiment?
Sentiment analysis often conflates "tone" with "intent":
| Response | Sentiment Tools Say | Actual Intent |
|---|---|---|
| "I'd love to, but I'm swamped." | Positive ("love") | NO |
| "Fine, I'll do it." | Negative | YES |
| "How about Tuesday instead?" | Neutral | Counter-offer |
| "I guess so, if I have to." | Negative | YES (reluctant) |
This library disentangles these signals.
Features
- Zero Dependencies: Fast, heuristic-based scoring
- Explainable: Returns evidence phrases and confidence scores
- Actionable Output: Commitment level, needs_clarification flags, response types
- Offline-First: No API calls, no network required
Installation
pip install implicature-intent
Quick Start
from implicature_intent import analyze_intent
result = analyze_intent("I'd love to, but I have a conflict.")
print(result["orientation"]) # "NO"
print(result["sentiment_tone"]) # "positive"
print(result["intent_type"]) # "polite_reject"
print(result["mismatch"]) # True (tone contradicts intent)
Output Schema
{
# Core Intent
"orientation": "YES" | "NO" | "NON_COMMITTAL" | "UNKNOWN",
"intent_type": "direct_accept" | "polite_reject" | "angry_agreement" |
"reluctant_yes" | "conditional_yes" | "counter_offer" |
"soft_deferral" | "delegation" | ...,
# Response Classification
"response_type": "direct" | "conditional" | "counter_offer" |
"deferral" | "delegation" | "question",
# Sentiment & Tone
"sentiment_tone": "positive" | "negative" | "neutral" | "mixed",
"sentiment_score": -1.0 to 1.0,
# Actionable Signals
"commitment_level": 0.0 to 1.0, # How firm is this response?
"needs_clarification": bool, # Should you follow up?
"mismatch": bool, # Tone contradicts intent?
# Politeness
"politeness": "low" | "medium" | "high",
"politeness_score": 0.0 to 1.0,
# Explainability
"confidence": 0.0 to 1.0,
"evidence_phrases": list[str],
"explanation": str
}
Examples
Detecting Hidden "No"
analyze_intent("Thanks for thinking of me, but I'm slammed this week.")
# → orientation: "NO", intent_type: "polite_reject", sentiment_tone: "positive"
Angry Agreement
analyze_intent("It's a stupid idea, but fine, I'll do it.")
# → orientation: "YES", intent_type: "angry_agreement", mismatch: True
Counter-Offer
analyze_intent("How about we push it to next Tuesday instead?")
# → orientation: "NO", response_type: "counter_offer", needs_clarification: True
Conditional Yes
analyze_intent("Sure, as long as we can wrap up by 5pm.")
# → orientation: "YES", response_type: "conditional", intent_type: "conditional_yes"
Low Commitment
analyze_intent("I'll try my best, hopefully I can make it work.")
# → orientation: "YES", commitment_level: 0.2, needs_clarification: True
Use Cases
- Sales CRM: Detect when a lead is politely declining vs. genuinely interested
- Customer Support: Identify frustrated agreement vs. satisfied resolution
- Meeting Scheduling: Parse conditional availability and counter-offers
- Chatbots: Understand user intent beyond keyword matching
- Email Analysis: Flag responses that need follow-up
Limitations
- Sarcasm: Hard to detect without audio/visual cues or deeper context
- Domain-Specific Language: "I'll table this" might be YES or NO depending on culture
- Very Short Responses: "Ok" is ambiguous without context
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Build for distribution
python -m build
Roadmap
- v0.2: Evaluation harness with benchmark dataset
- v0.3: Domain tuning (sales, support, scheduling)
- v0.4: Optional LLM adapter for complex cases
License
MIT
Built by Loom Labs
Research Inspiration
This library is inspired by the research paper Disentangling Intent from Tone in Conversational Agents.
Release files for implicature-intent 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| implicature_intent-0.1.1.tar.gz | 13.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| implicature_intent-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.3 kB
Release files / implicature_intent-0.1.1.tar.gz
| Download URL | implicature_intent-0.1.1.tar.gz |
|---|---|
| Size | 13.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c88d3050fab3cdaec4898c6ed37b66a7ba90b75d8b36d5f1d38c22db9f73fcac
|
|
BLAKE2b-256 checksum How to use checksums |
37fa24c945d75e1c46784ce96bc344d2d81082d2d2a5804cd963f42721870ef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / implicature_intent-0.1.1-py3-none-any.whl
| Download URL | implicature_intent-0.1.1-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ec21f4bf80ccaed84c7dde483a4e6ed4c8dc5c30b3281db94e2c0aa1da959eb
|
|
BLAKE2b-256 checksum How to use checksums |
34e6f78cc72ba0fa5666803f078a635197a6fe0c6da324dfdd200b639b412357
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|