Use AI-powered Features
Wordize supports AI-powered features in documents of any format:
- to utilize AI-powered features such as document translation, grammar checking, and text summarization, use the Wordize AI for .NET module
- to work with documents in the required formats, select the appropriate document conversion module
Wordize provides the Wordize AI for .NET module – a powerful extension that brings advanced AI capabilities to your document workflows.
Wordize AI enables operations such as text summarization, grammar checking, and document translation using cutting-edge models from Anthropic, Google, and OpenAI.
Configure AI models
The Wordize AI module can be connected to Anthropic, Google, and OpenAI models. To do this, just use the appropriate AiModel class and specify the AiModelType.
Connect to the Anthropic AI Model using the Create method:
AiModel model = AnthropicAiModel.Create(AiModelType.Claude35Haiku, "<your_api_key>");Connect to the Google AI Model using the Create method:
AiModel model = GoogleAiModel.Create(AiModelType.Gemini15Flash, "<your_api_key>");Connect to the OpenAI Model using the Create method:
AiModel model = OpenAiModel.Create(AiModelType.Gpt4OMini, "<your_api_key>").WithOrganization("<organization>").WithProject("<project>");In addition to the standard models, you can use an LLM deployed on your server. Just select the appropriate AiModel class and specify the URL, name, and ApiKey:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");Translate Document Using AI
Translating documents using AI is convenient because it provides fast, accurate results without the need for manual effort. It also supports multiple languages and formats, making it easy to work with a wide range of content. To translate a document, use one of the Translate methods and one of the supported languages listed in the Language enumeration.
To translate a document, simply specify the input and output files, configure the AI model, and set the target language:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Translator.Translate("DocumentIn.docx", "DocumentOut.docx", model, Language.Ukrainian);If you need to render the translation result as an array of streams with images, use one of the TranslateToImages method:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Stream[] pages = Translator.TranslateToImages("DocumentIn.docx", new ImageSaveOptions(SaveFormat.Png), model, Language.Ukrainian);Translating documents using the Fluent API is convenient when you need to save the output in multiple file formats:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
TranslatorContext context = new TranslatorContext(model) { Language = Language.Ukrainian };
Translator.Create(context)
.From("DocumentIn.docx")
.To("DocumentOut.docx")
.To("DocumentOut.pdf")
.To("DocumentOut.xps")
.Execute();Summarize Document Using AI
Summarizing a document using AI is efficient because it saves time by quickly extracting key points from large volumes of text. It also helps you grasp the main ideas without reading the entire document. To summarize a document, use one of the Summarize methods
You can also optionally specify SummarizeOptions. Use the following values from the SummaryLength enumeration to set the summary length:
VeryShort– generates 1-2 sentencesShort– generates 3-4 sentencesMedium– generates 5-6 sentencesLong– generates 7-10 sentencesVeryLong– generates 11-20 sentences
Pass one or more documents to the Summarizer to produce a concise summary that accurately represents the content:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Summarizer.Summarize("DocumentIn.docx", "DocumentOut.docx", model, new SummarizeOptions() { SummaryLength = SummaryLength.VeryShort });If you need to render the summary result as an array of streams with images, use one of the SummarizeToImages method:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Stream[] pages = Summarizer.SummarizeToImages("DocumentIn.docx", new ImageSaveOptions(SaveFormat.Png), model);Easily specify multiple input documents for summarization and save the output in all required formats with a single call using the Fluent API:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
SummarizerContext context = new SummarizerContext(model);
context.SummarizeOptions.SummaryLength = SummaryLength.Long;
Summarizer.Create(context)
.From("DocumentIn1.docx")
.From("DocumentIn2.docx")
.To("DocumentOut.docx")
.To("DocumentOut.pdf")
.To("DocumentOut.html")
.Execute();Check Grammar Using AI
Checking grammar in a document using AI saves time by automatically identifying and suggesting corrections for errors. It also ensures consistency and improves the overall quality of your text without the need for manual proofreading.
Use the GrammarChecker class and one of the CheckGrammar methods to correct spelling, fix grammatical errors and typos, improve stylistic quality, and optionally track changes using revisions for later review:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
GrammarChecker.CheckGrammar("DocumentIn.docx", "DocumentOut.docx", model);Mark corrections with revisions:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
GrammarChecker.CheckGrammar("DocumentIn.docx", "DocumentOut.docx", model, new CheckGrammarOptions() { MakeRevisions = true });If you need to render the checked result as an array of streams with images, use one of the CheckGrammarToImages method:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
Stream[] pages = GrammarChecker.CheckGrammarToImages("DocumentIn.docx", new ImageSaveOptions(SaveFormat.Png), model, new CheckGrammarOptions() { ImproveStylistics = true });Checking grammar with the Fluent API and some CheckGrammarOptions:
AiModel model = OpenAiModel.Create("<api_url>", "<api_name>", "<api_key>");
GrammarCheckerContext context = new GrammarCheckerContext(model);
context.CheckGrammarOptions.MakeRevisions = true;
GrammarChecker.Create(context)
.From("DocumentIn.docx")
.To("DocumentOut.docx")
.Execute();