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 9270109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:17:25+00:00 2026-06-18T15:17:25+00:00

I am trying to use a Perceptron to perform supervised classification and thereby perform

  • 0

I am trying to use a Perceptron to perform supervised classification and thereby perform POS tagging of a sentence. I am assuming for now that the tags of each word is independent of the other. (i.e I am just using just the word as a feature). I am fairly new to Machine Learning algorithms, and so I am unable to figure out how to represent the feature function for each word.

I have a training set of 100 sentences, where each word is given a particular tag (say N, V, J(adjective) and so on).
For instance,

Jack(N) and(&) Jill(N) went(V) to(PRP) Peru(N)

where the tags are in braces. Lets say I have a total of 10 possible tags.
Now my question is how does the feature vector for the word Jack look like?

I am very much interested in implementing it as a vector, since my code will match the notation better. Once I figure out how the feature function looks like, I will be able to implement the Perceptron algorithm!

Also, say I want to add features like (a) Is first letter capitalized? (b) Is word hyphenated etc., How do I incorporate that into my feature vector?

Intuitively I can see that the vector needs to have only binary values, but I am unable to proceed beyond that.

Kindly try to explain with concrete examples if possible!

  • 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-06-18T15:17:26+00:00Added an answer on June 18, 2026 at 3:17 pm

    Use a dictionary which maps words to numeric ids. If your vocabulary has 10,000 items in it, your dictionary maps each word to a number in the range 0-9999 and every word is represented as a binary vector of length 10,000 where only one element is active: that corresponding to the word’s id in the dictionary.

    If you want extra features besides word ids, you can just tack these on to the end of the feature vector: that is, you can make features 10,000+ be the capitalisation feature, the previous tag feature (will need binary coding as above) etc.

    As a final point, POS tagging is an instance of a structured prediction problem, rather than a series of independent classifications. If this becomes more than an academic exercise, you’ll want to move to the structured perceptron, or another structured learning method like a CRF or struct-SVM.

    EDIT: a simple example

    Imagine I have a five word vocabulary, {the,cat,sat,on,mat}, and a reduced tagset {DET,N,V,PREP}. My sentence is thus:

    (The,DET) (cat,N) (sat,V) (on,PREP) (the,DET) (mat,N).

    Now I want a feature vector for each word, from which I would like to be able to predict the tag. I am going to use features 0-4 as my word id indicator functions, so that feature 0 corresponds to ‘the’, feature 1 to ‘cat’ and so on. This gives me the following feature vectors (with the intended ‘class’ or tag assignment following the ->):

    [1 0 0 0 0] -> DET
    [0 1 0 0 0] -> N
    [0 0 0 0 0] -> V
    ...
    

    I could treat these as instances and apply my learning algorithm of choice to this task, however, word ID functions alone won’t buy me much. I decide I want to incorporate some HMM-like intuition into my classifications, so I also add feature functions which indicate what the previous tag was. So I use features 5-8 as indicators for this, with 5 corresponding to DET, 6 to N, and so on. Now I have the following:

    [1 0 0 0 0 0 0 0 0] -> DET (because this is the first word there's no previous tag)
    [0 1 0 0 0 1 0 0 0] -> N
    [0 0 0 0 0 0 1 0 0] -> V
    

    Now I can keep adding features to my heart’s content, using for example feature 9 to indicate whether the word is capitalised or not, feature 10 might be whether the word matches a list of known proper nouns, etc etc. If you read a little about structured prediction tasks and methods, you should see why using a model customised for this task (easiest is an HMM, but I’d want to progress to a CRF/Structured Perceptron/StructSVM for state of the art performance) is superior to treating this as a bunch of independent decisions.

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

Sidebar

Related Questions

I am trying use a from a multi-dimensional array that I create in another
I have a regex that I'm trying use to validate against strings. Trying to
I have a 3rd party DLL that I am trying to use in a
I am trying use the jQuery table sorter plugin for a table that is
I am trying use the mysql connector in c++ in ubuntu. It appears that
I am trying use open graph API to publish an action. URL that I
i'm trying use facebook API to upload photo in my fan page. I downloaded
I am trying use gem tire to search in my application. I have tables
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on

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.