Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

template file: unigram #28

Open
csrgxtu opened this issue Mar 15, 2016 · 6 comments
Open

template file: unigram #28

csrgxtu opened this issue Mar 15, 2016 · 6 comments

Comments

@csrgxtu
Copy link

csrgxtu commented Mar 15, 2016

how can u explain the meaning of the following template:

U15:%x[-2,1]/%x[-1,1]
@garfieldnate
Copy link

U15 is the feature id/name. The %x[...] sections are templates specifying what parts of the data vectors to make in the feature. The first number is the word index relative to the current word. The second number is the index of the feature. The numbers start at 0, not 1.

Let's say your features look like this:

Word POS
I pronoun
am verb
very adverb
tired adjective

This is a 2-d data vector extracted from the sentence "I am very tired." When CRF++ is trying to classify the word "very", %x[-2,1] would refer to two tokens previous, the second feature (POS). %x[-1,1] would be the previous token, second feature (POS). So in this example the value given by your template would be pronoun/verb.

@zhugw
Copy link

zhugw commented Aug 7, 2017

@garfieldnate Thanks. I have another question: does below are same?

U15:%x[-2,1]/%x[-1,1]
U15:%x[-2,1]%x[-1,1] # without '/'

and except '/' does has any other sign could exist in template e.g. + - | and so on and what is the mean

@garfieldnate
Copy link

My guess is that the first would generate tokens like "a/cat" and the second would generate tokens like "acat". I would leave the slash there, because without it the bigram for "a way" will look the same as the unigram for "away". I don't know if you can use other characters instead. You should try it and tell us if it works. I haven't been using this project for a while (moved to new job).

@fjwu
Copy link

fjwu commented Nov 26, 2017

i am new to crf++ and i wan to perform testing and traing.but when i type vim crf_learn the terminal opens a blank screen demanding for input .I donot know what to type here.Can you help me to resolve this issue??thanks

@ankur220693
Copy link

@garfieldnate I have converted my tagged data into vector form
Can I use Vector as a input in CRF++
My vector file is in (.txt) format
vector

@garfieldnate
Copy link

@ankur220693 I'm sorry I haven't been using this project for over 2 years now. I do not know the answer!

How did you create this "Vector" format? What program did you use?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants