IntentRecognizer class
모든 코어 인식기의 기본 클래스입니다. 인식기의 조건부 실행 및 인식된 의도의 사후 필터링을 허용합니다. 파생 클래스는 추상 onRecognize() 메서드를 재정의해야 합니다.
메서드
| on |
인식기를 조건부로 사용하거나 사용하지 않도록 설정하는 함수를 등록합니다. 여러 처리기를 등록할 수 있으며 다른 처리기 전에 새 처리기가 실행됩니다. |
| on |
인식기에서 출력을 필터링하는 함수를 등록합니다. 여러 처리기를 등록할 수 있으며 다른 처리기 후에 새 처리기가 실행됩니다. |
| on |
파생 클래스에 의해 재정의되어 실제 인식 논리를 구현합니다. |
| recognize(IRecognize |
사용자 텍스트 발화를 의도와 일치시키려고 시도합니다. |
메서드 세부 정보
onEnabled((context: IRecognizeContext, callback: (err: Error, enabled: boolean) => void) => void)
인식기를 조건부로 사용하거나 사용하지 않도록 설정하는 함수를 등록합니다. 여러 처리기를 등록할 수 있으며 다른 처리기 전에 새 처리기가 실행됩니다.
function onEnabled(handler: (context: IRecognizeContext, callback: (err: Error, enabled: boolean) => void) => void)
매개 변수
- handler
-
(context: IRecognizeContext, callback: (err: Error, enabled: boolean) => void) => void
모든 메시지에 대해 호출된 함수입니다. 인식해야 하는 모든 메시지에 대해 callback(null, true) 호출해야 합니다.
반환
onFilter((context: IRecognizeContext, result: IIntentRecognizerResult, callback: (err: Error, result: IIntentRecognizerResult) => void) => void)
인식기에서 출력을 필터링하는 함수를 등록합니다. 여러 처리기를 등록할 수 있으며 다른 처리기 후에 새 처리기가 실행됩니다.
function onFilter(handler: (context: IRecognizeContext, result: IIntentRecognizerResult, callback: (err: Error, result: IIntentRecognizerResult) => void) => void)
매개 변수
- handler
-
(context: IRecognizeContext, result: IIntentRecognizerResult, callback: (err: Error, result: IIntentRecognizerResult) => void) => void
함수는 점수가 0.0보다 큰 의도를 생성하는 모든 메시지에 대해 호출됩니다.
callback(null, { score: 0.0, intent: null }) 호출하여 의도가 반환되지 않도록 차단해야 합니다.
반환
onRecognize(IRecognizeContext, (err: Error, result: IIntentRecognizerResult) => void)
파생 클래스에 의해 재정의되어 실제 인식 논리를 구현합니다.
function onRecognize(context: IRecognizeContext, callback: (err: Error, result: IIntentRecognizerResult) => void)
매개 변수
- context
- IRecognizeContext
인식되는 수신된 메시지에 대한 컨텍스트 정보입니다.
- callback
-
(err: Error, result: IIntentRecognizerResult) => void
인식 작업의 결과를 사용하여 호출하는 함수입니다.
recognize(IRecognizeContext, (err: Error, result: IIntentRecognizerResult) => void)
사용자 텍스트 발화를 의도와 일치시키려고 시도합니다.
function recognize(context: IRecognizeContext, callback: (err: Error, result: IIntentRecognizerResult) => void)
매개 변수
- context
- IRecognizeContext
인식되는 수신된 메시지에 대한 컨텍스트 정보입니다.
- callback
-
(err: Error, result: IIntentRecognizerResult) => void
인식 작업의 결과를 사용하여 호출하는 함수입니다.