Skip to main content

Augment Arabic data for deep learning tasks

Project description

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.  

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

araugment-1.0.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

araugment-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file araugment-1.0.0.tar.gz.

File metadata

  • Download URL: araugment-1.0.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for araugment-1.0.0.tar.gz
Algorithm Hash digest
SHA256 99ab1092d650cd5a5aa6dd770e787c0ea77b77d2f0820e8caae359f15f9f3e4c
MD5 5f8c520683d5ba25e1cb74bced275ffe
BLAKE2b-256 3af8fb6e2eaaa836c2ed81d03706f25d3f491608b84691458e53a98af35efe96

See more details on using hashes here.

File details

Details for the file araugment-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: araugment-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for araugment-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09fb4f062d66b9f9bb61b6616af87239c4cc927c0b19997bca7488f7d8937f2d
MD5 059c555cb1485f33363491f3ea2e1011
BLAKE2b-256 faad0e793180126186bece72fc2ff94d1df0a560eb23219b13a0b31b9460b187

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page