التضمينات
تعرف على كيفية تحويل النص إلى متجهات تضمين والعثور على نسبة التشابه بين نصين منفصلين.
سنغطي ما يلي...
نقطة نهاية التضمينات
التضمين هو طريقة لتمثيل البيانات في متجه من الأرقام المتصلة. يمكننا توفير هذه المتجهات لخوارزميات ونماذج التعلم الآلي. للنصوص المتشابهة متجهات التضمين نفسها، وللنصين المختلفين تضمينات مختلفة تمامًا. تأخذ API OpenAI النص إدخال وتُرجع متجه التضمين.
استدعاء واجهة API) للتضمينات
للحصول على متجه تضمين لجزء من النص، يمكننا استدعاء الوظيفة التالية:
response = client.embeddings.create(input="The text whose embeddings are required",model="<model_name>")
فهم نقطة نهاية التضمينات
دعونا نلقي نظرة على نقطة نهاية التضمينات بمزيد من التفصيل، ومراجعة معلمات طلب ومعلمات استجابة .
معلمات الطلب
دعونا نلقي نظرة على المعلمات المطلوبة لتقديم طلب في نقطة نهاية التضمينات.
Fields | Format | Type | Description |
| String | Required | The ID of the engine to use for this request. |
| String/Array | Required | Input text for embedding, encoded as either a string or an array of tokens. For embedding multiple inputs within a single request, provide an array consisting of strings or arrays of tokens. The input size should not surpass the maximum input token limit for the model (8192 tokens for |
| String | Optional | The format in which embeddings is returned. The returned format can either be |
| Integer | Optional | The specified number of dimensions for the resulting output embeddings. This feature is supported starting from |
| String | Optional | A unique identifier that represents your end-user, aiding OpenAI in monitoring and identifying potential misuse or abuse. |
ملاحظة : ...