Instruction query method, computer program product and associated query system
An instruction query method, a computer program product, and an associated query system are provided. A software program is stored in the computer program product, and the software program performs the instruction query method. The instruction query method includes the following steps. Firstly, a language translator translates a non-English query string into an English query string according to a language identification code. Then, a prompt tuning module transforms the English query string into an English interactive prompt string according to at least one high-relevance token vector. The at least one high-relevance token vector relates to the operating instructions of an electronic device. Afterward, the language translator translates an English reply string into a non-English reply string according to the language identification code. The English reply string is generated based on inferences made from the English interactive prompt string.
1 . An instruction query method, comprising steps of:
performing, by a semantic parser, sentence decomposition and token splitting on at least one English document to generate at least one JavaScript Object Notation file, wherein the at least one English document records operating instructions of an electronic device;
performing, by a word vector model, data vectorization on the at least one JavaScript Object Notation file to generate a plurality of pre-stored token vectors;
storing, by a vector database, the pre-stored token vectors;
translating, by a language translator, a non-English query string into an English query string according to a language identification code;
searching, by the vector database, among the pre-stored token vectors according to the English query string to obtain at least one high-relevance token vector;
receiving, by a prompt tuning module, the English query string from the language translator, and the at least one high-relevance token vector from the vector database;
transforming, by the prompt tuning module, the English query string into an English interactive prompt string according to the at least one high-relevance token vector, wherein the at least one high-relevance token vector relates to the operating instructions of the electronic device; and
translating, by the language translator, an English reply string into a non-English reply string according to the language identification code, wherein the English reply string is generated based on inferences made from the English interactive prompt string.
2 . The instruction query method according to claim 1 , wherein the English reply string is generated by a pre-trained transformer based on the inferences made from the English interactive prompt string.
3 . The instruction query method according to claim 1 , further comprising a step of:
transmitting, by the language translator, metadata related to a model of the electronic device to the vector database, wherein the vector database searches among the pre-stored token vectors according to the metadata and the English query string to obtain the at least one high-relevance token vector.
4 . The instruction query method according to claim 1 , further comprising a step of:
storing the obtained at least one high-relevance token vector into a vector data temporary storage module.
5 . The instruction query method according to claim 1 , further comprising a step of:
identifying, by the language translator, a language corresponding to the non-English query string to generate the language identification code.
6 . The instruction query method according to claim 1 , wherein the language identification code is a default code.
7 . The instruction query method according to claim 1 , wherein the electronic device comprises an input device generating and transmitting the non-English query string to the language translator in response to a user input.
8 . The instruction query method according to claim 7 , wherein the language identification code represents a language corresponding to the user input.
9 . The instruction query method according to claim 1 , wherein the electronic device comprises an output device outputting the non-English reply string received from the language translator.