title: Scikit-learn: How to extract features from the text?
body: <p>Assume I have an array of Strings:</p>
  
  <pre><code>['Laptop Apple Macbook Air A1465, Core i7, 8Gb, 256Gb SSD, 15"Retina, MacOS' ... 'another device description']
  </code></pre>
  
  <p>I'd like to extract from this description features like:</p>
  
  <pre><code>item=Laptop
  brand=Apple
  model=Macbook Air A1465
  cpu=Core i7
  ...
  </code></pre>
  
  <p>Should I prepare the pre-defined known features first? Like</p>
  
  <pre><code>brands = ['apple', 'dell', 'hp', 'asus', 'acer', 'lenovo']
  cpu = ['core i3', 'core i5', 'core i7', 'intel pdc', 'core m', 'intel pentium', 'intel core duo']
  </code></pre>
  
  <p>I am not sure that I need to use <code>CountVectorizer</code> and <code>TfidfVectorizer</code> here, it's more appropriate to have <code>DictVictorizer</code>, but how can I make dicts with keys extracting values from the entire string?</p>
  
  <p>is it possible with scikit-learn's Feature Extraction? Or should I make my own <code>.fit()</code>, and <code>.transform()</code> methods?</p>
  
  <p>UPDATE:
  @sergzach, please review if I understood you right:</p>
  
  <pre><code>data = ['Laptop Apple Macbook..', 'Laptop Dell Latitude...'...]
  
  for d in data:
      for brand in brands:
         if brand in d:
            # ok brand is found
  for model in models:
         if model in d:
            # ok model is found
  </code></pre>
  
  <p>So creating N-loops per each feature? This might be working, but not sure if it is right and flexible.</p>