CheckGrammar
Inhalt
[
Ausblenden
]IAiModelText.CheckGrammar method
Überprüft die Grammatik des bereitgestellten Dokuments. Dieser Vorgang nutzt das verbundene KI-Modell zur Überprüfung der Grammatik des Dokuments.
public Document CheckGrammar(Document sourceDocument, CheckGrammarOptions options = null)
Parameter | Typ | Beschreibung |
---|---|---|
sourceDocument | Document | Das Dokument wird auf Grammatik geprüft. |
options | CheckGrammarOptions | Optionale Einstellungen zur Steuerung der Grammatikprüfung. |
Rückgabewert
Ein neuesDocument
mit geprüfter Grammatik.
Beispiele
Zeigt, wie die Grammatik eines Dokuments überprüft wird.
Document doc = new Document(MyDir + "Big document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// Verwenden Sie generative Sprachmodelle von OpenAI.
IAiModelText model = (OpenAiModel)AiModel.Create(AiModelType.Gpt4OMini).WithApiKey(apiKey);
CheckGrammarOptions grammarOptions = new CheckGrammarOptions();
grammarOptions.ImproveStylistics = true;
Document proofedDoc = model.CheckGrammar(doc, grammarOptions);
proofedDoc.Save(ArtifactsDir + "AI.AiGrammar.docx");
Siehe auch
- class Document
- class CheckGrammarOptions
- interface IAiModelText
- namensraum Aspose.Words.AI
- Montage Aspose.Words