nlp2cmd-intent
NL → IntentIR: normalizacja, detekcja intencji, encje.
Kanoniczna implementacja KeywordIntentDetector — nlp2cmd re-eksportuje ją z nlp2cmd.generation.keywords.
Użycie
from nlp2cmd_intent import IntentPipeline, analyze_query, ensure_intent_clear
intent = IntentPipeline().run("znajdź pliki *.py w src")
print(intent.intent, intent.target_kind, intent.confidence)
if intent.needs_clarification():
# confidence < 0.5 lub niepuste ambiguities
...
ensure_intent_clear(intent, enforced=True) # raises IntentClarificationRequired
structure = analyze_query("znajdź pliki *.py w src", include_plan=True)
Egzekwowanie clarification
flowchart LR
IR[IntentIR] --> NC{needs_clarification?}
NC -->|plan — zawsze| BLOCK[IntentClarificationRequired]
NC -->|show — opcjonalnie| ENV{NLP2CMD_ENFORCE_CLARIFICATION=1}
ENV -->|tak| BLOCK
ENV -->|nie| OK[kontynuuj]
| Ścieżka | Zachowanie |
|---|---|
nlp2cmd plan |
zawsze blokuje przy niskiej pewności |
nlp2dsl show |
tylko z NLP2CMD_ENFORCE_CLARIFICATION=1 |
Kontrakty Intract (plan steps) — w nlp2cmd, nie w tym pakiecie. Zob. docs/intract-integration.md.
CLI (przez nlp2dsl-show)
nlp2dsl show "znajdź pliki *.py w src"
Instalacja
pip install -e packages/pact-ir
pip install -e packages/nlp2cmd-intent
Pliki danych
Bundlowane w src/nlp2cmd_intent/data/:
patterns.jsonkeyword_intent_detector_config.json
Override: NLP2CMD_PATTERNS_FILE, NLP2CMD_DETECTOR_CONFIG_FILE, NLP2CMD_CONFIG_DIR.
Metadata
Release files for nlp2cmd-intent 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nlp2cmd_intent-0.1.2.tar.gz | 35.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nlp2cmd_intent-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 73.9 kB
Release files / nlp2cmd_intent-0.1.2.tar.gz
| Download URL | nlp2cmd_intent-0.1.2.tar.gz |
|---|---|
| Size | 35.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6a4c0f1adb166bda6b9559a43f59a4afadbc95d613c58f645c51cd786e2caaed
|
|
BLAKE2b-256 checksum How to use checksums |
c2272fbad4c4f77d7e06ba848aee7478411210be209e5a0c2d49e07eb12b18ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / nlp2cmd_intent-0.1.2-py3-none-any.whl
| Download URL | nlp2cmd_intent-0.1.2-py3-none-any.whl |
|---|---|
| Size | 38.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1c19d2b306e3052934cde6c134fb1bee304be4a4261791229a8292de671c5b59
|
|
BLAKE2b-256 checksum How to use checksums |
5ad9b7a5172003df23d6cd9e52485b664cc9740b6233239c085f185ab5b4ad6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|