Answers.Body: <p>You need to make the training data as given below.</p>
  
  <pre><code>U.N. I-ORG 
  official O 
  Ekeus I-PER 
  heads O 
  for O 
  Baghdad I-LOC
  </code></pre>
  
  <p>Treat this as a classification task. here in given example, we have 3 classes ( <code>I-ORG</code> <code>I-PER</code> and <code>I-LOC</code> ).
  Now you can process such data using Multilayer Perceptron. LSTM, or CNN or Ensemble of all.
  For detail you may follow this <a href="http://learningdeep.xyz/designing-a-machine-learning-model/" rel="nofollow noreferrer">blog</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-17T04:55:24.030Z
Answers.LastActivityDate: 2018-08-17T04:55:24.030Z
Answers.UserDisplayName: Patel Sunil
Answers.Body: <p>For your specific problem i would use a hierarchical search.
  The first step should be to separate the text, each fragment should contain several entities, but would be more easy to identify them.</p>
  
  <p>For example:</p>
  
  <ul>
  <li>Location, Dates, prices: You can use regex search, <a href="https://stackoverflow.com/questions/24722484/named-entity-recognition-regex-for-places">link</a>.</li>
  <li>Specifications, locations: You can try using Deep Learning with character level bigrams, or word bigrams. </li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-16T15:31:59.330Z
Answers.LastActivityDate: 2018-08-16T15:31:59.330Z
Answers.UserDisplayName: andres
Body: <p>I have a 100-150 words text and I want to extract particular information like location, product type, dates, specifications and price.</p>
  
  <p>Suppose if I arrange a training data which has a text as input and location/product/dates/specs/price as a output value. So I want to train the model for these specific output only.</p>
  
  <p>I have tried Spacy and NLTK for entity extraction but that doesn't suffice above requirements.</p>
  
  <p>Sample text:</p>
  
  <blockquote>
    <p>Supply of Steel Fabrication Items. 
    General Item . 
    Construction Material . 
    Hardware Stores and Tool . 
    Construction of Security Fence. - Angle Iron 65x65x6mm for fencing post of height 3.5, Angle Iron 65x65x6mm for fencing post of height 3.5, MS Flat 50 x 5mm of 2.60m height, Angle Iron 50x50x6mm for Strut post of height 3.10mtr, Angle Iron 50x50x6mm for fencing post of height 1.83, Angle Iron 50x50x6mm for fencing post of height 1.37, Barbed wire made out of GI wire of size 2.24mm dia, Chain link fence dia 4 mm and size of mesh 50mm x, Concertina Coil 600mm extentable up to 6 mtr, Concertina Coil 900mm extentable up to 15 to 20 mtr, Binding wire 0.9mm dia., 12 mm dia 50mm long bolts wih nuts &amp; 02 x washers, Cement in polythene bags 50 kgs each grade 43 OPC, Sand Coarse confiming to IS - 383-970, 2nd revision, Crushed Stone Aggregate 20 mm graded, TMT Bar 12mm dia with 50mm U bend, Lime 1st quality, Commercial plywood 6' x 3' x 12 mm., Nails all Type 1" 2"3" 4" 5" and 6"., Primer Red Oxide, Synthetic enamel paint, colour black/white Ist quality . 
    Angle Iron 65x65x6mm for fencing post of height 3.5, Angle Iron 65x65x6mm for fencing post of height 3.5 mtr, MS Flat 50 x 5mm of 2.60m height, Angle Iron 50x50x6mm for Strut post of height 3.10mtr, Barbed wire made out of GI wire of size 2.24mm dia, Chain link fence dia 4 mm and size of mesh 50mm x, Concertina Coil 600mm extentable up to 6 mtr, Binding wire 0.9mm dia., 12 mm dia 50mm long bolts with nuts &amp; 02 x washers, Cement in polythene bags 50 kgs each grade 43 OPC, Sand Coarse confiming to IS - 383-970, 2nd revision, Crushed Stone Aggregate 20 mm graded, TMT Bar 12mm dia with 50mm U bend, Lime 1st quality, Commercial plywood 6' x 3' x 12 mm., Nails all Type 1" 2"3" 4" 5" and 6"., Primer Red Oxide, Synthetic enamel paint, colour black/white Ist quality., Cutting Plier 160mm long, Leather Hand Gloves/Knitted industrial, Ring Spanner of 16mm x 17mm, 14 x 16mm, Crowbar hexagonal 1200mm long x 40mm, Plumb bob steel, Bucket steel 15 ltr capacity (as per, Plastic water tank 500 ltrs Make - Sintex, Water level pipe 30 Mtr, Brick Hammer 250 Gms with handle, Hack saw Blade double side, Welding Rod, Cutting rod for making holes, HDPE Sheet 5' x 8', Plastic Measuring tape 30 Mtr, Steel Measuring tape 5 Mtr, Wooden Gurmala 6"x3", Steel Pan Mortar of 18"dia (As, Showel GS with wooden handle, Phawarah with wooden handle (As per, Digital Vernier Caliper, Digital Weighing Machine cap 500 Kgs, Portable Welding Machine, Concrete mixer machine of 8 CFT . 
    Angle Iron 65x65x6mm for fencing post of height 3.5, Angle Iron 65x65x6mm for fencing post of height 3.5, MS Flat 50 x 5mm of 2.60m height, Angle Iron 50x50x6mm for Strut post of height 3.10mtr, Barbed wire made out of GI wire of size 2.24mm dia, Chain link fence dia 4 mm and size of mesh 50mm, Concertina Coil 600mm extentable up to 6 mtr, Binding wire 0.9mm dia., 12 mm dia 50mm long bolts with nuts &amp; 02 x washers, Cement in polythene bags 50 kgs each grade 43, Sand Coarse confiming to IS - 383-970, 2nd revision, Crushed Stone Aggregate 20 mm graded, TMT Bar 12mm dia with 50mm U bend, Lime 1st quality, Commercial plywood 6' x 3' x 12 mm., Nails all Type 1" 2"3" 4" 5" and 6"., Primer Red Oxide, Synthetic enamel paint, colour black/white Ist quality., Cutting Plier 160mm long, Leather Hand Gloves/Knitted industrial, Ring Spanner of 16mm x 17mm, 14 x 16mm, Crowbar hexagonal 1200mm long x 40mm, Plumb bob steel, Bucket steel 15 ltr capacity (as per, Plastic water tank 500 ltrs Make - Sintex, Water level pipe 30 Mtr, Brick Hammer 250 Gms with handle, Hack saw Blade double side, Welding Rod, Cutting rod for making holes, HDPE Sheet 5' x 8', Plastic Measuring tape 30 Mtr, Steel Measuring tape 5 Mtr, Wooden Gurmala 6"x3", Steel Pan Mortar of 18"dia (As per, Showel GS with wooden handle, Phawarah with wooden handle (As per, Digital Vernier Caliper)</p>
  </blockquote>
  
Tags: <machine-learning><deep-learning><natural-language-processing>
Title: How can I train model to extract custom entities from text?
UserDisplayName: Dilip Lilaramani
ThreadText: # How can I train model to extract custom entities from text?
  
  (Asked by: username_0 on 2018-08-16)
  
  I have a 100-150 words text and I want to extract particular information like location, product type, dates, specifications and price.
  
  Suppose if I arrange a training data which has a text as input and location/product/dates/specs/price as a output value. So I want to train the model for these specific output only.
  
  I have tried Spacy and NLTK for entity extraction but that doesn't suffice above requirements.
  
  Sample text:
  
  > Supply of Steel Fabrication Items.
  > General Item .
  > Construction Material .
  > Hardware Stores and Tool .
  > Construction of Security Fence. - Angle Iron 65x65x6mm for fencing post of height 3.5, Angle Iron 65x65x6mm for fencing post of height 3.5, MS Flat 50 x 5mm of 2.60m height, Angle Iron 50x50x6mm for Strut post of height 3.10mtr, Angle Iron 50x50x6mm for fencing post of height 1.83, Angle Iron 50x50x6mm for fencing post of height 1.37, Barbed wire made out of GI wire of size 2.24mm dia, Chain link fence dia 4 mm and size of mesh 50mm x, Concertina Coil 600mm extentable up to 6 mtr, Concertina Coil 900mm extentable up to 15 to 20 mtr, Binding wire 0.9mm dia., 12 mm dia 50mm long bolts wih nuts & 02 x washers, Cement in polythene bags 50 kgs each grade 43 OPC, Sand Coarse confiming to IS - 383-970, 2nd revision, Crushed Stone Aggregate 20 mm graded, TMT Bar 12mm dia with 50mm U bend, Lime 1st quality, Commercial plywood 6' x 3' x 12 mm., Nails all Type 1" 2"3" 4" 5" and 6"., Primer Red Oxide, Synthetic enamel paint, colour black/white Ist quality .
  > Angle Iron 65x65x6mm for fencing post of height 3.5, Angle Iron 65x65x6mm for fencing post of height 3.5 mtr, MS Flat 50 x 5mm of 2.60m height, Angle Iron 50x50x6mm for Strut post of height 3.10mtr, Barbed wire made out of GI wire of size 2.24mm dia, Chain link fence dia 4 mm and size of mesh 50mm x, Concertina Coil 600mm extentable up to 6 mtr, Binding wire 0.9mm dia., 12 mm dia 50mm long bolts with nuts & 02 x washers, Cement in polythene bags 50 kgs each grade 43 OPC, Sand Coarse confiming to IS - 383-970, 2nd revision, Crushed Stone Aggregate 20 mm graded, TMT Bar 12mm dia with 50mm U bend, Lime 1st quality, Commercial plywood 6' x 3' x 12 mm., Nails all Type 1" 2"3" 4" 5" and 6"., Primer Red Oxide, Synthetic enamel paint, colour black/white Ist quality., Cutting Plier 160mm long, Leather Hand Gloves/Knitted industrial, Ring Spanner of 16mm x 17mm, 14 x 16mm, Crowbar hexagonal 1200mm long x 40mm, Plumb bob steel, Bucket steel 15 ltr capacity (as per, Plastic water tank 500 ltrs Make - Sintex, Water level pipe 30 Mtr, Brick Hammer 250 Gms with handle, Hack saw Blade double side, Welding Rod, Cutting rod for making holes, HDPE Sheet 5' x 8', Plastic Measuring tape 30 Mtr, Steel Measuring tape 5 Mtr, Wooden Gurmala 6"x3", Steel Pan Mortar of 18"dia (As, Showel GS with wooden handle, Phawarah with wooden handle (As per, Digital Vernier Caliper, Digital Weighing Machine cap 500 Kgs, Portable Welding Machine, Concrete mixer machine of 8 CFT .
  > Angle Iron 65x65x6mm for fencing post of height 3.5, Angle Iron 65x65x6mm for fencing post of height 3.5, MS Flat 50 x 5mm of 2.60m height, Angle Iron 50x50x6mm for Strut post of height 3.10mtr, Barbed wire made out of GI wire of size 2.24mm dia, Chain link fence dia 4 mm and size of mesh 50mm, Concertina Coil 600mm extentable up to 6 mtr, Binding wire 0.9mm dia., 12 mm dia 50mm long bolts with nuts & 02 x washers, Cement in polythene bags 50 kgs each grade 43, Sand Coarse confiming to IS - 383-970, 2nd revision, Crushed Stone Aggregate 20 mm graded, TMT Bar 12mm dia with 50mm U bend, Lime 1st quality, Commercial plywood 6' x 3' x 12 mm., Nails all Type 1" 2"3" 4" 5" and 6"., Primer Red Oxide, Synthetic enamel paint, colour black/white Ist quality., Cutting Plier 160mm long, Leather Hand Gloves/Knitted industrial, Ring Spanner of 16mm x 17mm, 14 x 16mm, Crowbar hexagonal 1200mm long x 40mm, Plumb bob steel, Bucket steel 15 ltr capacity (as per, Plastic water tank 500 ltrs Make - Sintex, Water level pipe 30 Mtr, Brick Hammer 250 Gms with handle, Hack saw Blade double side, Welding Rod, Cutting rod for making holes, HDPE Sheet 5' x 8', Plastic Measuring tape 30 Mtr, Steel Measuring tape 5 Mtr, Wooden Gurmala 6"x3", Steel Pan Mortar of 18"dia (As per, Showel GS with wooden handle, Phawarah with wooden handle (As per, Digital Vernier Caliper)
  
  **Tags:** machine-learning, deep-learning, natural-language-processing
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-08-17. Score: 2
  
  You need to make the training data as given below.
  U.N. I-ORG 
  official O 
  Ekeus I-PER 
  heads O 
  for O 
  Baghdad I-LOC
  
  Treat this as a classification task. here in given example, we have 3 classes ( I-ORG I-PER and I-LOC ).
  Now you can process such data using Multilayer Perceptron. LSTM, or CNN or Ensemble of all.
  For detail you may follow this blog
  
  
  ---
  
  ### Answer by username_2 on 2018-08-16. Score: 1
  
  For your specific problem i would use a hierarchical search.
  The first step should be to separate the text, each fragment should contain several entities, but would be more easy to identify them.
  
  For example:
  
  * Location, Dates, prices: You can use regex search, [link](https://stackoverflow.com/questions/24722484/named-entity-recognition-regex-for-places).
  * Specifications, locations: You can try using Deep Learning with character level bigrams, or word bigrams.
  
  
  ---
  
  