Summarizer.Summarize
Summarize(string, string, AiModel, SummarizeOptions)
Generates summary for the document, with options to control the summary length and other settings.
public static void Summarize(string inputFile, string outputFile, AiModel model,
SummarizeOptions options = null)
Parameter | Type | Description |
---|---|---|
inputFile | String | The input file name. |
outputFile | String | The output file name. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | SummarizeOptions | Optional set of options used when summarizing a document with AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
Examples
Shows how to create custom OpenAiModel and perform document summarization.
string apiUrl = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_URL", EnvironmentVariableTarget.User);
string apiName = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_NAME", EnvironmentVariableTarget.User);
string apiKey = Environment.GetEnvironmentVariable("CUSTOM_OPENAI_KEY", EnvironmentVariableTarget.User);
AiModel model = OpenAiModel.Create(apiUrl, apiName, apiKey);
SummarizeOptions options = new SummarizeOptions() { SummaryLength = SummaryLength.VeryShort };
Summarizer.Summarize(MyDir + "SimpleAI.docx", ArtifactsDir + "Summarize.docx", model, options);
See Also
- class AiModel
- class SummarizeOptions
- class Summarizer
- namespace Wordize.AI
- assembly Wordize
Summarize(string[], string, AiModel, SummarizeOptions)
Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected AI model for processing each document in the array.
public static void Summarize(string[] inputFiles, string outputFile, AiModel model,
SummarizeOptions options = null)
Parameter | Type | Description |
---|---|---|
inputFiles | String[] | The input file names. |
outputFile | String | The output file name. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | SummarizeOptions | Optional set of options used when summarizing a document with AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
See Also
- class AiModel
- class SummarizeOptions
- class Summarizer
- namespace Wordize.AI
- assembly Wordize
Summarize(string, string, SaveFormat, AiModel, SummarizeOptions)
Generates summary for the document, with options to control the summary length and other settings.
public static void Summarize(string inputFile, string outputFile, SaveFormat saveFormat,
AiModel model, SummarizeOptions options = null)
Parameter | Type | Description |
---|---|---|
inputFile | String | The input file name. |
outputFile | String | The output file name. |
saveFormat | SaveFormat | The save format. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | SummarizeOptions | Optional set of options used when summarizing a document with AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
See Also
- enum SaveFormat
- class AiModel
- class SummarizeOptions
- class Summarizer
- namespace Wordize.AI
- assembly Wordize
Summarize(string[], string, SaveFormat, AiModel, SummarizeOptions)
Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected AI model for processing each document in the array.
public static void Summarize(string[] inputFiles, string outputFile, SaveFormat saveFormat,
AiModel model, SummarizeOptions options = null)
Parameter | Type | Description |
---|---|---|
inputFiles | String[] | The input file names. |
outputFile | String | The output file name. |
saveFormat | SaveFormat | The save format. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | SummarizeOptions | Optional set of options used when summarizing a document with AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
See Also
- enum SaveFormat
- class AiModel
- class SummarizeOptions
- class Summarizer
- namespace Wordize.AI
- assembly Wordize
Summarize(Stream, Stream, SaveFormat, AiModel, SummarizeOptions)
Generates summary for the document, with options to control the summary length and other settings.
public static void Summarize(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
AiModel model, SummarizeOptions options = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The save format. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | SummarizeOptions | Optional set of options used when summarizing a document with AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
See Also
- enum SaveFormat
- class AiModel
- class SummarizeOptions
- class Summarizer
- namespace Wordize.AI
- assembly Wordize
Summarize(Stream[], Stream, SaveFormat, AiModel, SummarizeOptions)
Generates summaries for an array of documents, with options to control the summary length and other settings. This method utilizes the connected AI model for processing each document in the array.
public static void Summarize(Stream[] inputStreams, Stream outputStream, SaveFormat saveFormat,
AiModel model, SummarizeOptions options = null)
Parameter | Type | Description |
---|---|---|
inputStreams | Stream[] | The input streams. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The save format. |
model | AiModel | Specifies the AI model responsible for generating the summary of a document. |
options | SummarizeOptions | Optional set of options used when summarizing a document with AI. |
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
See Also
- enum SaveFormat
- class AiModel
- class SummarizeOptions
- class Summarizer
- namespace Wordize.AI
- assembly Wordize