Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3987784
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:10:30+00:00 2026-05-20T06:10:30+00:00

Can someone help me with the syntax for hunpos tagging a corpus in nltk?

  • 0

Can someone help me with the syntax for hunpos tagging a corpus in nltk?

  1. What do I import for the hunpos.HunPosTagger module?

  2. How do I HunPosTag the corpus? See the code below.


import nltk 
from nltk.corpus import PlaintextCorpusReader  
from nltk.corpus.util import LazyCorpusLoader  

corpus_root = './'  
reader = PlaintextCorpusReader (corpus_root, '.*')  

ntuen = LazyCorpusLoader ('ntumultien', PlaintextCorpusReader, reader)  
ntuen.fileids()  
isinstance (ntuen, PlaintextCorpusReader)  


# So how do I hunpos tag `ntuen`? I can't get the following code to work.
# please help me to correct my python syntax errors, I'm new to python 
# but i really need this to work. sorry
##from nltk.tag import hunpos.HunPosTagger
ht = HunPosTagger('english.model')
for sentence in ntu.sent() ##looping through the no. of sentence
     ht.tag(ntusent()[i])
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:10:30+00:00Added an answer on May 20, 2026 at 6:10 am
    import nltk 
    from nltk.tag.hunpos import HunposTagger
    from nltk.tokenize import word_tokenize
    
    corpus = "so how do i hunpos tag my ntuen ? i can't get the following code to work."
    #please help me to correct my python syntax errors, i'm new to python 
    #but i really need this to work. sorry
    ##from nltk.tag import hunpos.HunPosTagger
    ht = HunposTagger('en_wsj.model')
    print ht.tag(word_tokenize(corpus))
    

    I feel like the problem is you’re not tokenizing the words, but there are other reasons the code may not work (it’s HunposTagger, not HunPosTagger). I made this simplified example from your question. If you have any more questions please post a comment.

    I got everything from here: http://code.google.com/p/hunpos/

    python hunpos.py

    [(‘so’, ‘RB’), (‘how’, ‘WRB’), (‘do’, ‘VBP’), (‘i’, ‘FW’), (‘hunpos’, ‘NN’), (‘tag’, ‘NN’), (‘my’, ‘PRP$’), (‘ntuen’, ‘NN’), (‘?’, ‘.’), (‘i’, ‘FW’), (‘ca’, ‘MD’), ("n’t", ‘RB’), (‘get’, ‘VB’), (‘the’, ‘DT’), (‘following’, ‘JJ’), (‘code’, ‘NN’), (‘to’, ‘TO’), (‘work’, ‘VB’), (‘.’, ‘.’)]

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I clearly still don't understand plyr syntax, as illustrated below. Can someone help me
Can someone help me figuring out why the following jQuery code doesn't work? I
Can someone help me to find web-page or resource where can I see what
Can someone help me with smarty syntax for in_array? I want to check if
can someone help me with syntax please... I am parsing a file and am
Can someone help me identify what the purpose of this unidentified syntax is. It
map(tuple, map(lambda row: [float(row[0]), int(row[1]), parse(row[2])], res)) Can someone help me with the syntax
I'm new to python and came across this segment of code. Can someone help
Can someone help me with my Syntax/Methodology? I would like to set up a
Can someone help me with this: This is a program to find all the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.