-
Notifications
You must be signed in to change notification settings - Fork 33.9k
[i18n-ar] Translated file : docs/source/ar/pad_truncation.md into Arabic
#33050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
AhmedAlmaghz
wants to merge
18
commits into
huggingface:main
from
AhmedAlmaghz:Add_docs_source_ar_pad_truncation.md
Closed
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
0ce416a
Add docs/source/ar/pad_truncation.md to Add_docs_source_ar_pad_trunca…
AhmedAlmaghz 1ca6764
Create _toctree.yml
AhmedAlmaghz 1a94839
Update _toctree.yml
AhmedAlmaghz 41d72ef
Update _toctree.yml - tasks_explained
AhmedAlmaghz 7765d6c
Update _toctree.yml - tokenizer_summary
AhmedAlmaghz 5ccdf41
Update _toctree.yml - model_summary
AhmedAlmaghz fd2f0a6
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz b6b7b7e
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz 22f3229
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz b435773
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz ab8f551
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz b9d98c0
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz cc0cd38
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz cbd6411
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz b2fdc45
Update docs/source/ar/pad_truncation.md
AhmedAlmaghz 75a5f60
Update _toctree.yml - attention
AhmedAlmaghz 9a99d59
Update _toctree.yml - pad_truncation
AhmedAlmaghz daa9fbf
Merge pull request #26 from AhmedAlmaghz/Update_toctree_yml
AhmedAlmaghz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # الحشو والتقليم | ||
|
|
||
| غالباً ما تكون الإدخالات المجمعة مختلفة الطول، لذا لا يمكن تحويلها إلى مصفوفات ذات حجم ثابت. الحشو والتقليم هما استراتيجيتان للتعامل مع هذه المشكلة، لإنشاء مصفوفات مستطيلة من مجموعات ذات أطوال مختلفة. ويضيف الحشو رمز **حشو** خاص لضمان أن يكون للتسلسلات الأقصر نفس طول أطول تسلسل في دفعة أو الطول الأقصى الذي يقبله النموذج. ويعمل التقليم في الاتجاه الآخر عن طريق تقليم التسلسلات الطويلة. | ||
|
|
||
| في معظم الحالات، يعمل حشو دفعتك إلى طول أطول تسلسل وتقليمه إلى الطول الأقصى الذي يمكن أن يقبله النموذج بشكل جيد للغاية. ومع ذلك، تدعم واجهة برمجة التطبيقات المزيد من الاستراتيجيات إذا كنت بحاجة إليها. هناك ثلاثة حجج تحتاجها: `padding`، و`truncation`، و`max_length`. | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
|
|
||
| يحكم حجة `padding` الحشو. يمكن أن يكون منطقيًا أو سلسلة: | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
|
|
||
| - `True` أو `'longest'`: الحشو إلى أطول تسلسل في الدفعة (لا يتم تطبيق الحشو إذا قدمت | ||
| تسلسل واحد فقط). | ||
| - `'max_length'`: الحشو إلى طول محدد بواسطة حجة `max_length` أو الطول الأقصى الذي يقبله | ||
| النموذج إذا لم يتم توفير `max_length` (`max_length=None`). سيظل الحشو مطبقًا إذا قدمت تسلسلًا واحدًا فقط. | ||
| - `False` أو `'do_not_pad'`: لا يتم تطبيق أي حشو. هذا هو السلوك الافتراضي. | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
|
|
||
| تحكم حجة `truncation` التقليم. يمكن أن يكون منطقيًا أو سلسلة: | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
|
|
||
| - `True` أو `'longest_first'`: اقطع إلى طول أقصى محدد بواسطة حجة `max_length` أو | ||
| الطول الأقصى الذي يقبله النموذج إذا لم يتم توفير `max_length` (`max_length=None`). هذا سوف | ||
| تقليم رمزا برمز، وإزالة رمز من أطول تسلسل في الزوج حتى يتم الوصول إلى الطول الصحيح. | ||
| - `'only_second'`: اقطع إلى طول أقصى محدد بواسطة حجة `max_length` أو الطول الأقصى | ||
| يقبل النموذج إذا لم يتم توفير `max_length` (`max_length=None`). هذا سيقلم فقط | ||
| الجملة الثانية من زوج إذا تم توفير زوج من التسلسلات (أو دفعة من أزواج التسلسلات). | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
| - `'only_first'`: اقطع إلى طول أقصى محدد بواسطة حجة `max_length` أو الطول الأقصى | ||
| يقبل النموذج إذا لم يتم توفير `max_length` (`max_length=None`). هذا سيقلم فقط | ||
| الجملة الأولى من زوج إذا تم توفير زوج من التسلسلات (أو دفعة من أزواج التسلسلات). | ||
| - `False` أو `'do_not_truncate'`: لا يتم تطبيق أي تقليم. هذا هو السلوك الافتراضي. | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
|
|
||
| تحكم حجة `max_length` طول الحشو والتقليم. يمكن أن يكون عدد صحيح أو `None`، وفي هذه الحالة سيتم تعيينه افتراضيًا إلى الطول الأقصى الذي يمكن أن يقبله النموذج. إذا لم يكن للنموذج طول إدخال أقصى محدد، يتم إلغاء تنشيط التقليم أو الحشو إلى `max_length`. | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
|
|
||
| يوضح الجدول التالي الطريقة الموصى بها لإعداد الحشو والتقليم. إذا كنت تستخدم أزواج تسلسلات الإدخال في أي من الأمثلة التالية، فيمكنك استبدال `truncation=True` بـ `STRATEGY` المحدد في | ||
| `['only_first'، 'only_second'، 'longest_first']`، أي `truncation='only_second'` أو `truncation='longest_first'` للتحكم في كيفية تقليم كل من التسلسلات في الزوج كما هو مفصل سابقًا. | ||
|
AhmedAlmaghz marked this conversation as resolved.
Outdated
|
||
| <!-- This file is automatically generated, do not modify manually. --> | ||
|
|
||
| # حيل الترميز | ||
|
|
||
| هناك العديد من الاستراتيجيات لترميز دفعات الجمل. فيما يلي بعض الأمثلة على ذلك. | ||
|
|
||
| | الترميز | الحشو | التعليمات | | ||
| |--------------------------------------|-----------------------------------|---------------------------------------------------------------------------------------------| | ||
| | لا ترميز | لا حشو | `tokenizer(batch_sentences)` | | ||
| | | الحشو إلى الحد الأقصى للتسلسل في الدفعة | `tokenizer(batch_sentences, padding=True)` أو | | ||
| | | | `tokenizer(batch_sentences, padding='longest')` | | ||
| | | الحشو إلى الحد الأقصى لطول إدخال النموذج | `tokenizer(batch_sentences, padding='max_length')` | | ||
| | | الحشو إلى طول محدد | `tokenizer(batch_sentences, padding='max_length', max_length=42)` | | ||
| | | الحشو إلى مضاعف لقيمة معينة | `tokenizer(batch_sentences, padding=True, pad_to_multiple_of=8)` | | ||
| | الترميز إلى الحد الأقصى لطول إدخال النموذج | لا حشو | `tokenizer(batch_sentences, truncation=True)` أو | | ||
| | | | `tokenizer(batch_sentences, truncation=STRATEGY)` | | ||
| | | الحشو إلى الحد الأقصى للتسلسل في الدفعة | `tokenizer(batch_sentences, padding=True, truncation=True)` أو | | ||
| | | | `tokenizer(batch_sentences, padding=True, truncation=STRATEGY)` | | ||
| | | الحشو إلى الحد الأقصى لطول إدخال النموذج | `tokenizer(batch_sentences, padding='max_length', truncation=True)` أو | | ||
| | | | `tokenizer(batch_sentences, padding='max_length', truncation=STRATEGY)` | | ||
| | | الحشو إلى طول محدد | غير ممكن | | ||
| | الترميز إلى طول محدد | لا حشو | `tokenizer(batch_sentences, truncation=True, max_length=42)` أو | | ||
| | | | `tokenizer(batch_sentences, truncation=STRATEGY, max_length=42)` | | ||
| | | الحشو إلى الحد الأقصى للتسلسل في الدفعة | `tokenizer(batch_sentences, padding=True, truncation=True, max_length=42)` أو | | ||
| | | | `tokenizer(batch_sentences, padding=True, truncation=STRATEGY, max_length=42)` | | ||
| | | الحشو إلى الحد الأقصى لطول إدخال النموذج | غير ممكن | | ||
| | | الحشو إلى طول محدد | `tokenizer(batch_sentences, padding='max_length', truncation=True, max_length=42)` أو | | ||
| | | | `tokenizer(batch_sentences, padding='max_length', truncation=STRATEGY, max_length=42)` | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.