<p>My pipilene (in general) for similar task.</p>
<h3>I don't use nn to solve a whole task</h3>
<p>First, I don't use NNs directly to label separate entities like &quot;camera&quot;, &quot;screen&quot; etc. There's some good approaches which might be useful, like a <a href="https://arxiv.org/abs/1506.03134" rel="nofollow noreferrer">pointer networks</a> or just <a href="http://akosiorek.github.io/ml/2017/10/14/visual-attention.html" rel="nofollow noreferrer">attention</a>, but it just didn't wotk in my case.<br />
I guess, this architectures don't work well because there are a lot of noise, aka &quot;I'm so glad I bought this TV&quot; or so in my dataset. Approx. 75% overall, and the rest of the data is not so clean, to.</p>
<p>Because of this, I do some additional actions:</p>
<ol>
<li>Split sentences into chunks (<em>sometimes</em> they contatins desired entities)</li>
<li>Label this chunks by hand into &quot;non-useful&quot; (aka &quot;I'm so happy/so upset&quot; etc.) and useful: &quot;good camera&quot;, &quot;bad phone&quot; etc.</li>
<li>Train classifier(s) to classify this data.</li>
</ol>
<h3>Details about a pipeline</h3>
<p><strong>How to &quot;recognize&quot; entities</strong><br />
I just used regexps and part-of-speech tags to split my data. But I work with russian language dataset, so there's not good free syntax parser / library for russian. If you work with english or another language, well-presented in spacy or nltk libraries, you can use it for parsing to separate entities. Also, english grammar is so strict in contrast to russian - it's make your task easier probably.<br />
Anyway, try to start with regexes and parsing.</p>
<p>Vocabularies with keywords for topics like &quot;camera&quot;, &quot;battery&quot;, ... are very helpful, too.</p>
<p>Another approach to recognize entities is topic modellig - PLSA/LDA (<a href="https://radimrehurek.com/gensim/" rel="nofollow noreferrer">gensim</a> rocks), but it's hard to tune, imo, because there are lot of noise in texts. You'll get a lot of topics <code>{&quot;happy&quot;, &quot;glad&quot;, &quot;bought&quot;, &quot;family&quot;, ...}</code> and so on - but you can try topic modelling anyway.</p>
<p>Also you can create a dataset with an entities labels for each text and train a NN with attention, so you can recognize it by high attention, but create this dataset is very tedious.</p>
<p><strong>Create dataset and train NN's</strong><br />
I start to create dataset only when I've got acceptable quality of &quot;named entities&quot; - because if you change this (footing) part later, you probalby can throw away a dataset and start it from scratch again.</p>
<p>Better decide which labels you will use once and then don't change them - it's critical part of work.</p>
<p>Training NN's on such data is easiest part of the work probably - just any good classifier, as for the whole texts. Even not a nn, but a simplier calssifiers might be useful - use blending, bagging etc.</p>
<p><strong>Possible troubles</strong><br />
There's a trap - some reviews / features not so obvious for NN classifier or even for a human, like &quot;loud sound&quot; or &quot;gets very hot&quot;. Often they context-depentend. So, I use a little help of our team to mark a dataset - so, each entry was labeld by a group of humans to get better quality. Also I use <em>context labels</em> - category of a product - adding a context for each entity: so, &quot;loud sound&quot; for audio system and for washing mashing bears controversal sentiment and model can learn it. Most cases category labels easy accessable throug databases/web parsing.</p>
<p>Hope it helps, also I hope someone knows a better approach.</p>
Is it possible to let a neural network classify entities based on classified documents?
<p>I tagged a dataset of texts with independent categories. When running a CNN classifier in Keras, I receive an accuracy of > 90%. </p>

<p>My texts are customer reviews "I really liked the camera of this phone." Classes are e.g. "phone camera", "memory" etc.</p>

<p>What I am searching for is whether I can tag the sentences with categories that appear in them while the classifier marks the entities that indicate the class. Or more specifically: How can I extract those parts of the input sentence that made a CNN network in Keras opt (i.e. classify) for 1, 2 or more categories?</p>