CheckGrammar
محتويات
[
يخفي
]IAiModelText.CheckGrammar method
يتحقق من قواعد اللغة للمستند المقدم. تستفيد هذه العملية من نموذج الذكاء الاصطناعي المتصل للتحقق من قواعد اللغة للمستند.
public Document CheckGrammar(Document sourceDocument, CheckGrammarOptions options = null)
معامل | يكتب | وصف |
---|---|---|
sourceDocument | Document | الوثيقة التي يتم التحقق من قواعدها النحوية. |
options | CheckGrammarOptions | إعدادات اختيارية للتحكم في كيفية التحقق من القواعد النحوية. |
قيمة الإرجاع
جديدDocument
مع التدقيق النحوي.
أمثلة
يوضح كيفية التحقق من قواعد اللغة في المستند.
Document doc = new Document(MyDir + "Big document.docx");
string apiKey = Environment.GetEnvironmentVariable("API_KEY");
// استخدم نماذج اللغة التوليدية 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");
أنظر أيضا
- class Document
- class CheckGrammarOptions
- interface IAiModelText
- مساحة الاسم Aspose.Words.AI
- المجسم Aspose.Words