{"id":13723222,"url":"https://github.com/adhaamehab/textblob-ar","last_synced_at":"2025-05-07T16:32:29.169Z","repository":{"id":52704171,"uuid":"133101298","full_name":"adhaamehab/textblob-ar","owner":"adhaamehab","description":"Arabic support for textblob","archived":true,"fork":false,"pushed_at":"2021-10-21T18:08:35.000Z","size":4448,"stargazers_count":85,"open_issues_count":17,"forks_count":25,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-12T14:17:35.418Z","etag":null,"topics":["arabic-language","arabic-nlp","machine-learning","natural-language-processing","nlp","part-of-speech-tagger","sentiment-analysis","spelling-correction","text-classification","text-similarity","textblob","word-embeddings"],"latest_commit_sha":null,"homepage":"https://github.com/sloria/TextBlob","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adhaamehab.png","metadata":{"files":{"readme":"README.rst","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-12T00:40:16.000Z","updated_at":"2024-11-27T18:49:37.000Z","dependencies_parsed_at":"2022-09-10T04:05:07.927Z","dependency_job_id":null,"html_url":"https://github.com/adhaamehab/textblob-ar","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Ftextblob-ar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Ftextblob-ar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Ftextblob-ar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adhaamehab%2Ftextblob-ar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adhaamehab","download_url":"https://codeload.github.com/adhaamehab/textblob-ar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252915472,"owners_count":21824571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arabic-language","arabic-nlp","machine-learning","natural-language-processing","nlp","part-of-speech-tagger","sentiment-analysis","spelling-correction","text-classification","text-similarity","textblob","word-embeddings"],"created_at":"2024-08-03T01:01:37.416Z","updated_at":"2025-05-07T16:32:24.156Z","avatar_url":"https://github.com/adhaamehab.png","language":"Python","funding_links":[],"categories":["GitHub projects"],"sub_categories":[],"readme":"===========\ntextblob-ar [WIP]\n===========\n\n.. image:: https://travis-ci.org/adhaamehab/textblob-ar.svg?branch=master\n    :target: https://travis-ci.org/adhaamehab/textblob-ar\n\nArabic language support for `TextBlob`_.\n\nFeatures\n--------\n\n* Tokenizer\n* Sentiment analysis\n* Stanford Arabic POS\n* Spelling Correction\n* Text similarity\n* Fasttext arabic word2vec interface\n\nUsage\n-----\n\n**Tokenizer**\n  \n.. code-block:: python\n\n    \u003e\u003e\u003e from textblob_ar import TextBlob\n    \u003e\u003e\u003e blob = TextBlob(u\"\"\"هندسة البرمجيات هي دراسة تصميم وتنفيذ وتعديل البرمجيات بما يضمن توفر هذه البرمجيات بجودة عالية وتكلفة معقولة متاحة للجميع وقابلة للتطوير فيما بعد وسريعة للبناء. وهندسة البرمجيات تقوم على أسس ونظريات من الهندسة وعلوم الحاسب كمبدأ ال Functional Structure من الهندسة والذي يعتمد على مبدأ تصميم أجزاء صغيرة تتجانس في العمل مع بعضها لتشكل عمل الكل.\"\"\")\n    \u003e\u003e\u003e blob.tokens\n    WordList(['هندسة', 'البرمجيات', 'هي', 'دراسة', 'تصميم', 'وتنفيذ', 'وتعديل', 'البرمجيات', 'بما', 'يضمن', 'توفر', 'هذه', 'البرمجيات', 'بجودة', 'عالية', 'وتكلفة', 'معقولة', 'متاحة', 'للجميع', 'وقابلة', 'للتطوير', 'فيما', 'بعد', 'وسريعة', 'للبناء', '.', 'وهندسة', 'البرمجيات', 'تقوم', 'على', 'أسس', 'ونظريات', 'من', 'الهندسة', 'وعلوم', 'الحاسب', 'كمبدأ', 'ال', 'Functional', 'Structure', 'من', 'الهندسة', 'والذي', 'يعتمد', 'على', 'مبدأ', 'تصميم', 'أجزاء', 'صغيرة', 'تتجانس', 'في', 'العمل', 'مع', 'بعضها', 'لتشكل', 'عمل', 'الكل', '.'])\n\n\n**Sentiment**\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from textblob_ar import TextBlob\n    \u003e\u003e\u003e blob = TextBlob('اعجبني هذا الكتاب. اعترض قليلا مع بعض افكاره لكن مضمونه رائع')\n    \u003e\u003e\u003e blob.sentiment\n    Sentiment(polarity=0.8, subjectivity=0.9)\n    \u003e\u003e\u003e blob = TextBlob('لم يعجبني هذا الكتاب. مضمونه سئ')\n    \u003e\u003e\u003e blob.sentiment\n    Sentiment(polarity=-0.6999999999999998, subjectivity=0.6666666666666666)\n\n\n**Stanford POS**\n\nNote that Stanford POS is the defualt one untill the main one is released\n.. code-block:: python\n\n    \u003e\u003e\u003e from textblob_ar import TextBlob\n    \u003e\u003e\u003e from textblob_ar.pos_tagger import StanfordPOSTagger\n    \u003e\u003e\u003e tagg = StanfordPOSTagger()\n    \u003e\u003e\u003e text = \"\"\" في أنظمة التشغيل متعددة المهام مثل اليونكس عفريت النظام هو برنامج يعمل في خلفية النظام بعيدا عن التحكم المباشر من المستحدم وغالبا ما يبدأ عمله كعملية خلفية مع بداية تشغيل النظام.\"\"\"\n    \u003e\u003e\u003e blob = TextBlob(text, pos_tagger=tagger)\n    \u003e\u003e\u003e print(blob.tags)\n    [('', 'في/IN'), ('', 'أنظمة/NN'), ('', 'التشغيل/DTNN'), ('', 'متعددة/JJ'), ('', 'المهام/DTNN'), ('', 'مثل/NN'), ('', 'اليونكس/DTNNP'), ('', 'عفريت/NNP'), ('', 'النظام/DTNN'), ('', 'هو/PRP'), ('', 'برنامج/NN'), ('', 'يعمل/VBP'), ('', 'في/IN'), ('', 'خلفية/NN'), ('', 'النظام/DTNN'), ('', 'بعيدا/JJ'), ('', 'عن/IN'), ('', 'التحكم/DTNN'), ('', 'المباشر/DTJJ'), ('', 'من/IN'), ('', 'المستحدم/DTNN'), ('', 'وغالبا/NN'), ('', 'ما/WP'), ('', 'يبدأ/VBP'), ('', 'عمله/NN'), ('', 'كعملية/JJ'), ('', 'خلفية/NN'), ('', 'مع/NN'), ('', 'بداية/NN'), ('', 'تشغيل/NN'), ('', 'النظام/DTNN')]\n\n\n**Text Correction**\n\nThanks for `Peter Norvig http://norvig.com/spell-correct.html`\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from textblob_ar import TextBlob\n    \u003e\u003e\u003e from textblob_ar.correction import TextCorrection\n    \u003e\u003e\u003e text = 'الاذدهاز'\n    \u003e\u003e\u003e TextCorrection().correct(text)\n    {'الاذهان', 'الازدهار', 'الادهان', 'الاندهاش'}\n    \u003e\u003e\u003e TextCorrection().correct(text, top=True)\n    'الازدهاز'\n\n**Text Similarity**\n\nBased on `gensim \u003chttps://radimrehurek.com/gensim\u003e`_ and `Fasttext \u003chttps://fasttext.cc/docs/en/pretrained-vectors.html\u003e`_  pretrained word2vec model \n\nThe procedure used in calculating similarity\nis calculating mean feature vector for each sentence.\nThen calculate the cosine distance between those two vectors.\n\n\n.. code-block:: python\n\n    \u003e\u003e\u003e from textblob_ar import TextSimilarity\n    \u003e\u003e\u003e sim = TextSimilarity()\n    # takes around 12 second (macbook pro 2017) to load the pretrained word2vec\n    \u003e\u003e\u003e sent1 = u'الإرهابي الصالح هي رواية خيال سياسي للكاتبة دوريس ليسينج. ظهرت أول طبعة للرواية في سبتمبر من عام 1985 للناشرين جوناثان كيب في المملكة المتحدة وألفريد أ'\n    \u003e\u003e\u003e sent2 = u'روايه الكاتبه دوريس ليسينج هي روايه خيال سياسي ظهرت في سبتمبر 1985 بعنوان الارهابي الصالح وتم نشرها عن طريق جوناثان كيب والفريد أ في انجلترا'\n    \u003e\u003e\u003e sim.similarity(sent1, sent2)\n    0.9611366391181946\n\n\nRequirements\n------------\n\n- Python \u003e= 3.3\n\nInstallation\n------------\n* Development\n\n.. code-block:: shell\n    $ git clone https://github.com/adhaamehab/textblob-ar.git\n    $ cd textblob_ar\n    $ virtualenv -p python3 env\n    $ source env/bin/activate\n    $ pip install -Ur dev-requirements.txt\n\nfor text similarity download fasttext arabic word2vec pretrained model from  `here \u003chttps://github.com/facebookresearch/fastText/blob/master/pretrained-vectors.md\u003e`_\n\n\nTODO\n----\n\n- Part Of Speech tagger\n- Noun-phrases extraction\n- Parser\n- Classification support\n- Grammer\n\n\nLicense\n-------\n\nMIT licensed. See the bundled `LICENSE \u003chttps://github.com/sloria/textblob-fr/blob/master/LICENSE\u003e`_ file for more details.\n\n.. _TextBlob: https://textblob.readthedocs.org/\n\n\n.. image:: https://badges.gitter.im/textblob-ar/community.svg\n   :alt: Join the chat at https://gitter.im/textblob-ar/community\n   :target: https://gitter.im/textblob-ar/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadhaamehab%2Ftextblob-ar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadhaamehab%2Ftextblob-ar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadhaamehab%2Ftextblob-ar/lists"}