title: How to build features for relation extraction for SVM?
body: <p>The field of interest: Information Extraction</p>
  
  <p>This is very new to me and I am trying to understand how to engineer features (whether lexical or semantic) in order to learn relationship in information extraction.</p>
  
  <p>From papers, one of the simple steps to take features for supervised learning in relations between two named entities is </p>
  
  <pre><code>* The sequence of words between the two entities
  * the part of speech tags of these words
  * bag of words between the two words
  </code></pre>
  
  <p>Shouldn't the number of words between the two entities change depending on the training sentence you are looking at? Then, how to build feature vectors which are not consistent in their sizes?</p>
  
  <p>For instance, see the following two sentences for learning person and organization with a relation: an owner of. </p>
  
  <pre><code>1. Mike is the owner of the company called, Spark.
  2. Denis owns the black building called Halo.
  </code></pre>
  
  <p>For the example 1, the number of words between Mike and Spark are [is, the, owner, of, the, company, called] which are 7 feature words, while for the example 2, we have [owns, the, black, building, called] 5 feature words.</p>
  
  <p>Where am I misunderstanding this problem? 
  Thank you!</p>