0
$\begingroup$

I want to train a classification neural network then predict some inputs. It's classic classification example as you know. I'm implementing this with python. I searched a lot about it and I always faced similar solution. I saw "bag of words" model. Then I implement it without library and created my word vectors. I'm not scraping news from web. I define them in some arrays like:

healthArticles = ["""bla bla bla""","""other healt articles"""]
sportArticles = ["""bla bla bla""","""other sport articles"""]

and etc. I refined my news, I cleared symbols, numbers. I only manipulate with word stem. Then I got word vectors of each articles like this:

[[1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 2, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,    1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]

I shortened my vectors when writing to here. They are much longer of this. The last index is representing the category of the news. So far, everything was fine. I searched and I implemented the model. But now I'm looking for classification. I saw Keras examples. I tried to implement various implemention but I can't. Cause they used library for convert words to vector. Then they create some keras layers, denses to fit this vector models. I can't code my own neural network because I don't have time. So I'm trying to use library for my train, test and prediction operations. I'm writing an example then I'm deleting it. So I can't put code part to here cause . I did a lot of research and viewed many samples.And additionaly, I don't want to copy use other peoples code. I'm trying to understand the logic of this classification method.

Can someone enlighten me on this? How can I continue my project?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.