Skip to main content

araugment

Version 1.0.0

Augment Arabic data for deep learning tasks

There are two methods in this library

  • back_translate: Translate text to a foreign language then translate back to original language to augment data
  • markov: This method uses Markov chains to string together n new sequences of words based on previous sequences.

Installation

pip install araugment

Usage

Back Translate

from araugment import back_translate
text = "بلغت العربية بفضل القرآن من الاتساع مدىً لا تكاد تعرفه أي لغة أخرى من لغات الدنيا"

#default value for original is "ar" which stands for Arabic
print(back_translate(text, original="ar", target="en"))
-> 'اللغة العربية بفضل القرآن من التوسع لا تحدد تقريبا بأي لغة أخرى'

Markov Chains

from araugment import markov
text = pd.read_csv('test.tsv', sep="\t", encoding='utf-8')
doc = text.loc[text.Target == "Neutral", 'Text'].tolist()
print(markov(doc, 5))
-> ['الخاص مليان سنين دون فاءده اتصلوا علي العملاء بلاغ رقم ومتاكده بلاغي مو اول واحد',
 'السلام عليكم عندي مشكله لي اسبوع رافعه طلب و لم يتم حل المشكله و البلاغ الحين ضمن البلاغات المغلقه',
 'و الله دخلته كذا بس مع هيك تعودنا نمد السلام',
 'سواق يمني جده توصيل مشاوير الحويه الطايف مكه جده وضواحيهابسعار مخفضه لتواصل خاص او واتساب',
 'ازمه كورونا يارب رحمتك بس']

License

araugment is licensed under the MIT License. The terms are as follows:

MIT License  

Copyright (c) 2021 ashaheedq  

Permission is hereby granted, free of charge, to any person obtaining a copy  
of this software and associated documentation files (the "Software"), to deal  
in the Software without restriction, including without limitation the rights  
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell  
copies of the Software, and to permit persons to whom the Software is  
furnished to do so, subject to the following conditions:  

The above copyright notice and this permission notice shall be included in all  
copies or substantial portions of the Software.  

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR  
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,  
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE  
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER  
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,  
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE  
SOFTWARE.  

Metadata

Release files for araugment 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for araugment 1.0.0
File Size Uploaded
araugment-1.0.0.tar.gz 4.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for araugment 1.0.0
File Interpreter ABI Platform
araugment-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / araugment-1.0.0.tar.gz

Download URL araugment-1.0.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
99ab1092d650cd5a5aa6dd770e787c0ea77b77d2f0820e8caae359f15f9f3e4c
BLAKE2b-256 checksum
How to use checksums
3af8fb6e2eaaa836c2ed81d03706f25d3f491608b84691458e53a98af35efe96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / araugment-1.0.0-py3-none-any.whl

Download URL araugment-1.0.0-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
09fb4f062d66b9f9bb61b6616af87239c4cc927c0b19997bca7488f7d8937f2d
BLAKE2b-256 checksum
How to use checksums
faad0e793180126186bece72fc2ff94d1df0a560eb23219b13a0b31b9460b187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page