# Uncertainty Detection: A Multi-View Decision Boundary Approach Against Healthcare Unknown Intents
## 3 A Multi-View Decision Boundary Learning Approach for Unknown Intent Detection
### First-Stage Training for Query Representation  
In the first stage, we train an intent classification model and remove the last classification layer to obtain a multi-view representation transformation for user queries, as shown in Figure 2. The model includes three kinds of inputs, corresponding to three involved views in the scenario. From the system designer's view, the textual description of intent categories can reflect their design concepts. In our design, all the intent label phrases are connected by spaces to form a sentence. Then, this intent sentence is encoded into a vector using a state-of-the-art embedding technique, the \"bert-base-chinese\" model from Google's team [36]. The chosen BERT-based model here has been pre-trained and is public. It contains a series of natural language processing (NLP) operations to tokenize the intent sentence and process tokens into a sequential set of word embedding vectors. Specifically, we calculate the average of all tokens' word vectors extracted from the last hidden layer of the BERT model to obtain the intent embedding \(e\). The input of the user view is the query utterance and is processed with the same embedding model. The \(i\)-th query \(q_{i}\) in the query dataset is tokenized and embedded into a sequential set of word embedding vectors using the parameters in the last hidden layer of the same BERT model. According to the conceptual model in Figure 1, the designer's view plays an \"attention\" role in understanding the user query. Therefore, we adopt a scaled dot-production attention mechanism to aggregate word embedding vectors of the user query based on the intent embedding \(e\) that represents task information from the designer's view. The aggregated calculation result is a sentence embedding vector of the user query, noted as \(s_{i}\). Figure 2: First-stage training framework for new representation learning. As for incorporating the medical expert view, we introduce a knowledge base as external medical knowledge to provide a professional view as an \"interpretation\" role according to the theory described in Section 2.3. The knowledge is stored in a triple format to indicate a relation between two entities. A knowledge base composed of triples can be visualized as a knowledge graph; hence, we adopt a knowledge graph embedding method, RotatE [54], to transfer entities to vector representations that contain medical information of a graphic structure view. The RotatE method defines each relation as a rotation from the source entity to the target entity in a complex vector space. It can model various relation patterns, including (anti)symmetry, inversion, and composition, ensuring the capture of complicated relations. Through this process, we can map each entity to a unique embedding containing graph structure information. In addition, all the entities in the knowledge base constitute a dictionary for subsequent entity recognition from user queries. For a given query sentence \(q_{i}\) in a textual format, we apply HanLP, a multilingual NLP library [55], to identify matched entities from the query based on the entity dictionary mentioned above. The library can be used to handle Chinese NLP tasks, such as tokenization, part-of-speech tagging, named entity recognition, and others. The recognized entity set of the query \(q_{i}\) is represented by the corresponding knowledge graph embeddings of the entities, noted as \(K_{i}=\{k_{i,0},\ k_{i,1},\ldots,k_{i,m_{i}-1}\}\), where \(m_{i}\) is the number of distinct entities. Following the \"integration\" concept in Figure 1, we concatenate the knowledge graph embedding with the query embedding \(s_{i}\) to form the complete input vector for the intent classification model of a fully connected network structure. The knowledge graph embedding \(k_{i}\) corresponding to query \(q_{i}\) is the average of all entity embeddings in the embedding set \(K_{i}\). This intent classification model is trained using the cross-entropy loss function.