مقدمة إلى نص TensorFlow
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوفر TensorFlow Text مجموعة من الفئات والعمليات ذات الصلة بالنص الجاهزة للاستخدام مع TensorFlow 2.0. يمكن للمكتبة إجراء المعالجة المسبقة التي تتطلبها النماذج النصية بشكل منتظم، وتتضمن ميزات أخرى مفيدة لنمذجة التسلسل التي لا يوفرها TensorFlow الأساسي.
تتمثل فائدة استخدام هذه العمليات في المعالجة المسبقة للنص في أنها تتم في الرسم البياني TensorFlow. لا داعي للقلق بشأن اختلاف الترميز في التدريب عن الترميز عند الاستدلال، أو إدارة البرامج النصية للمعالجة المسبقة.
تثبيت نص TensorFlow
التثبيت باستخدام النقطة
عند تثبيت TF Text مع تثبيت النقطة، لاحظ إصدار TensorFlow الذي تقوم بتشغيله، حيث يجب عليك تحديد الإصدار المقابل من TF Text.
pip install -U tensorflow-text==<version>
البناء من المصدر
يجب إنشاء نص TensorFlow في نفس بيئة TensorFlow. وبالتالي، إذا قمت بإنشاء TF Text يدويًا، فمن المستحسن بشدة أن تقوم أيضًا بإنشاء TensorFlow.
إذا كنت تستخدم نظام التشغيل MacOS، فيجب أن يكون لديك أدوات أساسية مثبتة. ربما يكون من الأسهل القيام بذلك باستخدام Homebrew. أولاً، قم ببناء TensorFlow من المصدر .
استنساخ الريبو نص TF.
git clone https://github.com/tensorflow/text.git
أخيرًا، قم بتشغيل البرنامج النصي للإنشاء لإنشاء حزمة النقاط.
./oss_scripts/run_build.sh
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-25 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Introduction to TensorFlow Text\n\n\u003cbr /\u003e\n\nTensorFlow Text provides a collection of text related classes and ops ready to\nuse with TensorFlow 2.0. The library can perform the preprocessing regularly\nrequired by text-based models, and includes other features useful for sequence\nmodeling not provided by core TensorFlow.\n\nThe benefit of using these ops in your text preprocessing is that they are done\nin the TensorFlow graph. You do not need to worry about tokenization in training\nbeing different than the tokenization at inference, or managing preprocessing\nscripts.\n\nInstall TensorFlow Text\n-----------------------\n\n### Install using pip\n\nWhen installing TF Text with pip install, note the version of TensorFlow you are\nrunning, as you should specify the corresponding version of TF Text. \n\n pip install -U tensorflow-text==\u003cversion\u003e\n\n### Build from source\n\nTensorFlow Text must be built in the same environment as TensorFlow. Thus, if\nyou manually build TF Text, it is highly recommended that you also build\nTensorFlow.\n\nIf building on MacOS, you must have coreutils installed. It is probably easiest\nto do with Homebrew. First, build TensorFlow\n[from source](https://www.tensorflow.org/install/source).\n\nClone the TF Text repo. \n\n git clone https://github.com/tensorflow/text.git\n\nFinally, run the build script to create a pip package. \n\n ./oss_scripts/run_build.sh"]]