Previously we only match commands with queries. Now we can extract command titles, so we should leverage both.
- Storing the embeddings of both commands and title. We will use three objects:
-
List[str], the commands themselves
- 2D
numpy.ndarray[float] the embeddings of the command phrases, one row per command,
- 2D
numpy.ndarray[float] the embeddings of the command titles, one row per command.
The three objects shall have the same length, which equals to the number of commands provided by VSCode and installed plug-ins.
- Matching a query. Denote the similarity measure function as $d$, the embedding of the query as $e_q$, and the embedding of a command as $e_c$, and the embedding of the command's title as $e_t$. Then the similarity of the query and the command is $max(d(e_q, e_c), d(e_q, e_t))$ -- tentatively set so. We can use other heuristics later.
Previously we only match commands with queries. Now we can extract command titles, so we should leverage both.
List[str], the commands themselvesnumpy.ndarray[float]the embeddings of the command phrases, one row per command,numpy.ndarray[float]the embeddings of the command titles, one row per command.The three objects shall have the same length, which equals to the number of commands provided by VSCode and installed plug-ins.