This commit is contained in:
team 1
2026-05-01 17:40:48 +02:00
parent 17cb098235
commit ad7cac72be
19 changed files with 1084 additions and 157 deletions

View File

@@ -50,7 +50,7 @@ final class CommerceIntentLite
return $this->buildDetectionResult(
intent: self::NONE,
score: 0,
signals: ['technical_factual_knowledge_query']
signals: [$this->config->getTechnicalFactualKnowledgeSignalLabel()]
);
}
@@ -167,18 +167,7 @@ final class CommerceIntentLite
private function isNonProductCommerceSignal(string $signal): bool
{
return in_array($signal, [
'shop',
'alle',
'kunde',
'online',
'kaufen',
'kostet',
'suche',
'such',
'finde',
'finden',
], true);
return in_array($signal, $this->config->getNonProductCommerceSignals(), true);
}
/**
@@ -191,37 +180,19 @@ final class CommerceIntentLite
*/
private function isTechnicalFactualKnowledgeQuery(string $prompt): bool
{
$hasQuestionMarker = $this->matchesAnyPattern($prompt, [
'/\bwas\s+ist\b/u',
'/\bwelche?r?s?\b/u',
'/\bwie\s+(hoch|niedrig|klein|gross|groß)\b/u',
'/\bniedrigste[rsn]?\b/u',
'/\bkleinste[rsn]?\b/u',
'/\bhöchste[rsn]?\b/u',
'/\bhoechste[rsn]?\b/u',
]);
$hasQuestionMarker = $this->matchesAnyPattern(
$prompt,
$this->config->getTechnicalFactualKnowledgeQuestionMarkerPatterns()
);
if (!$hasQuestionMarker) {
return false;
}
return $this->matchesAnyPattern($prompt, [
'/\bgrenzwert(?:e|en|es)?\b/u',
'/\bmessbereich(?:e|en|s)?\b/u',
'/\bwasserhärte\b/u',
'/\bwasserhaerte\b/u',
'/\bresthärte\b/u',
'/\bresthaerte\b/u',
'/\bgesamthärte\b/u',
'/\bgesamthaerte\b/u',
'/\bauflösung\b/u',
'/\baufloesung\b/u',
'/\bindikator(?:en|s)?\b/u',
'/\btestomat(?:en|s)?\b/u',
'/\büberwach(?:t|en|ung)\b/u',
'/\bueberwach(?:t|en|ung)\b/u',
'/\bmess(?:en|ung|bar|wert)\b/u',
]);
return $this->matchesAnyPattern(
$prompt,
$this->config->getTechnicalFactualKnowledgeFactPatterns()
);
}
/**