# US 2021/0342654 A1 · Machine-generated examples of command-line commands with parameter values

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0342654 A1
- Document ID: US20210342654A1
- Status: Published application
- Kind: A1
- Application number: 16/861,645
- Filed: 2020-04-29
- Published: 2021-11-04
- Earliest claimed: 2020-04-29
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC.
- Inventors: SPANDAN GARG; JASON R. SHAVER; NEELAKANTAN SUNDARESAN; ROSHANAK ZILOUCHIAN MOGHADDAM
- Web page: https://patentgrep.com/patent/US20210342654A1

## CPC

- G06F 8/73: Program documentation
- G06F 9/45512: {Command shells}
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/24323: {Tree-organised classifiers}
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 5/04: Inference or reasoning models
- G06N 20/00: Machine learning
- G06N 3/045: Combinations of networks
- G06N 3/084: Backpropagation, e.g. using gradient descent
- H04L 67/125: involving control of end-device applications over a network
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Examples of the usage of a command of a command line interface includes the command with a set of parameters and corresponding parameter values. The examples are generated from telemetry data, which does not contain parameter values, and from web-based sources that may contain multiple parameter values. A machine learning model is used to predict the data type of a parameter value when the parameter is used with a particular command. The predicted data type is then used to select an appropriate parameter value for the example from multiple known parameter values or to generate a parameter value when no known parameter value exists.

## Claims

### Claim 1

A system comprising:
one or more processors coupled to a memory; and
one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions that:
obtain a command and a parameter of the command, the command of a command line interface (CLI);
predict a data type of a parameter value of the parameter using a machine learning model;
use the predicted data type to search for a first parameter value from a plurality of parameter values for the parameter, the first parameter value having a same data type as the predicted data type; and
generate a CLI example of usage of the command with the first parameter value.

### Claim 2 (depends on 1)

The system of claim 1, wherein the one or more programs include further instructions that:
use a first classifier to predict a likelihood whether a first data type of a plurality of data types corresponds to the first parameter value.

### Claim 3 (depends on 2)

The system of claim 2, wherein the one or more programs include further instructions that:
use a second classifier to predict a likelihood whether a second data type of the plurality of data types corresponds to the parameter value when the first classifier fails to predict that the parameter value takes on the first type.

### Claim 4 (depends on 2)

The system of claim 2, wherein the one or more programs include further instructions that:
train the first classifier using features extracted from historical usage patterns of the command, the features including a command name, a parameter name and a module name.

### Claim 5 (depends on 3)

The system of claim 3, wherein the one or more programs include further instructions that:
train the second classifier using features extracted from command descriptions and parameter descriptions.

### Claim 6 (depends on 1)

The system of claim 1, wherein the one or more programs include further instructions that:
incorporate the generated CLI example into online documentation of the command and the parameter.

### Claim 7 (depends on 1)

The system of claim 1, wherein the one or more programs include further instructions that:
obtain a data type format for the predicted data type; and
use the data type format to find the first parameter value having the data type.

### Claim 8 (depends on 3)

The system of claim 3, wherein the first classifier and the second classifier are random forest classifiers.

### Claim 9

A method, comprising:
using a first classifier to predict a first data type of a parameter value of a paired command and parameter of a command line interface (CLI);
when the first classifier fails to predict that the parameter value is of the first data type, using a second classifier to predict a second data type for the parameter value of the paired command and parameter;
obtaining a parameter value matching the predicted second data type for the paired command and parameter from a plurality of parameter values for the paired command and parameter; and
generating a CLI example of usage of the paired command and parameter including the obtained parameter value.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
obtaining a plurality of parameter values for the paired command and parameter from historical usage;
generating a regular expression that matches a data format of the data type of the parameter value; and
using the regular expression to find the parameter value for the paired command and parameter.

### Claim 11 (depends on 9)

The method of claim 9, further comprising:
ranking the plurality of parameter values of the paired command and parameter in descending order of usage frequency; and
generating a regular expression that represents a highest-ranked data format of the parameter values of the paired command and parameter; and
using the regular expression to obtain a parameter value that matches the predicted data type.

### Claim 12 (depends on 10)

The method of claim 10, wherein the regular expression represents a single value, range of values or character string.

### Claim 13 (depends on 9)

The method of claim 9, further comprising:
incorporating the generated CLI example into online documentation of the command and the parameter.

### Claim 14 (depends on 9)

The method of claim 9, wherein the first classifier is a random forest trained on command names, parameter names, and a module name from which an example was extracted.

### Claim 15 (depends on 9)

The method of claim 9, wherein the second classifier is a random forest trained on descriptions of a command and descriptions of a parameter.

### Claim 16

A device, comprising:
a processor and a memory;
wherein the at least one processor is configured to:
generate a plurality of CLI examples showing usage of a command with a parameter and without a parameter value from a first historical usage source of CLI commands;
obtain parameter values from a second historical usage source of CLI commands, wherein a parameter value is associated with a command and parameter of the plurality of CLI examples;
infer a data type of a parameter value for a requested command and parameter pair using a machine learning model;
find a select one of the parameter values having a same data type as the inferred data type from the second historical usage source; and
generate a CLI example for the requested command and parameter pair using a select one of the plurality of CLI examples matching the requested command and parameter pair with the select one of the parameter values.

### Claim 17 (depends on 16)

The device of claim 16, wherein the machine learning model is composed of a first classifier and a second classifier, the first classifier predicts whether the requested command and parameter pair is of a first data type, the second classifier predicts whether the requested command and parameter pair are of a second data type, the first data type differs from the second data type.

### Claim 18 (depends on 16)

The device of claim 16, wherein the at least one processor is further configured to:
associate a data type format for the inferred data type; and
find the select one of the parameter values having a same data type as the inferred data type in the data type format.

### Claim 19 (depends on 18)

The device of claim 18, wherein the at least one processor is further configured to:
analyze frequency of occurrence of data type formats of a parameter from the parameter values;
generate a regular expression representing a data type format having a highest frequency; and
use the regular expression to find the select one of the parameter values having the same data type in the same data type format.

### Claim 20 (depends on 19)

The device of claim 19, wherein the regular expression indicates a character string, single value or range of values.
