Document AI
Ten Aspose.Words Document AI for .NET wtyczka umożliwia programistom tłumaczenie lub podsumowywanie dokumentów oraz sprawdzanie ich gramatyki. Integruje się z LLMs takimi jak Gemini, Claude i OpenAI.
Instalacja i konfiguracja
- Zainstaluj Aspose.Words dla .NET pakietu przez NuGet lub Package Manager Console.
- Skonfiguruj licencjonowanie rozliczane przed uruchomieniem operacji mail-merge.
Kompatybilny z Windows, Linux, macOS i platformy mobilne używając .NET Framework, .NET Core lub Mono. Obsługiwane IDE to Visual Studio (2010–2026), Xamarin i MonoDevelop 2.4+.
IDE: Visual Studio 2017–2026, JetBrains Rider, MonoDevelop.
Obsługiwane szablony / formaty wyjściowe: DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML, oraz Word 2007 XML.
Przetłumacz dokument
Przetłumacz swoje dokumenty na dowolny język reprezentowany w Język wyliczeniu:
Document doc = new Document(MyDir + "Document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use Google generative language models.
AiModel model = AiModel.Create(AiModelType.GeminiFlashLatest).WithApiKey(apiKey);
Document translatedDoc = model.Translate(doc, Language.Arabic);
translatedDoc.Save(ArtifactsDir + "AI.AiTranslate.docx");Podsumuj dokument
Wygeneruj podsumowanie dokumentu, określając jego długość:
- Bardzo krótkie – 1-2 zdania
- Krótkie – 3-4 zdania
- Średnie – 5-6 zdań
- Długie – 7-10 zdań
- Bardzo długie – 11-20 zdań
Document firstDoc = new Document("Big document.docx");
Document secondDoc = new Document("Document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use OpenAI or Google generative language models.
AiModel model = ((OpenAiModel)AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey)).WithOrganization("Organization").WithProject("Project");
SummarizeOptions options = new SummarizeOptions();
options.SummaryLength = SummaryLength.Short;
Document oneDocumentSummary = model.Summarize(firstDoc, options);
oneDocumentSummary.Save("AI.AiSummarize.One.docx");
options.SummaryLength = SummaryLength.Long;
Document multiDocumentSummary = model.Summarize(new Document[] { firstDoc, secondDoc }, options);
multiDocumentSummary.Save("AI.AiSummarize.Multi.docx");Sprawdź gramatykę dokumentu
Sprawdzaj gramatykę i wykrywaj błędy w dokumentach:
Document doc = new Document(MyDir + "Big document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Use OpenAI generative language models.
AiModel model = AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey);
CheckGrammarOptions grammarOptions = new CheckGrammarOptions();
grammarOptions.ImproveStylistics = true;
Document proofedDoc = model.CheckGrammar(doc, grammarOptions);
proofedDoc.Save("AI.AiGrammar.docx");Najczęściej zadawane pytania
- Q: Jakie formaty plików można używać z Document AI dla .NET? Ten Aspose.Words Document AI for .NET plugin obsługuje formaty DOC, DOCX, RTF, DOT, DOTX, DOTM, DOCM, Word 2003 XML, oraz Word 2007 XML.
- Q: Jakich modeli mogę używać z Aspose.Words Document AI dla .NET? Document AI dla .NET może być zintegrowane z LLM‑ami takimi jak Gemini, Claude i OpenAI.