title: POS Tagging arabic text using nltk in Python
body: <p>I'm trying to <code>POS tagging</code> an <code>arabic</code> text with <code>NLTK</code> using <code>Python 3.6</code>, I found this program:</p>
  
  <pre><code>import nltk
  
  text = """ و نشر العدل من خلال قضاء مستقل ."""
  
  sentence = nltk.tokenize.sent_tokenize(text)
  
  # tokens = [nltk.tokenize.word_tokenize(s) for s in sentence]
  tokens = [nltk.tokenize.wordpunct_tokenize(s) for s in sentence]
  
  # Here pos tagging isn't right :'(
  PosTokens = [nltk.pos_tag(e) for e in tokens]
  
  chunks = nltk.ne_chunk_sents(PosTokens)
  
  for tree in chunks:
      print(tree)
  </code></pre>
  
  <p><strong>Result :</strong></p>
  
  <pre><code>(S
    و/JJ
    (ORGANIZATION نشر/NNP)
    العدل/NNP
    من/NNP
    خلال/NNP
    قضاء/NNP
    مستقل/NNP
    ./.)
  </code></pre>
  
  <p>This is a bad result, for example:
  Although 'نشر' is verb,it's giving me a noun 'NNP'.</p>
  
  <p><strong><em>The right result is :</em></strong></p>
  
  <pre><code>  (S (CC و)
      (VP (VBD نشر)
        (NP (DTNN العدل))
        (PP (IN من)
          (NP (NN خلال)
            (NP (NN قضاء) (JJ مستقل)))))
      (PUNC .))
  </code></pre>