2
$\begingroup$

There exists a similar task that is named text classification.

But I want to find a kind of model that the inputs are keyword set. And the keyword set is not from a sentence.

For example:

input ["apple", "pear", "water melon"] --> target class "fruit"
input ["tomato", "potato"] --> target class "vegetable"

Another example:

input ["apple", "Peking", "in summer"]  -->  target class "Chinese fruit"
input ["tomato", "New York", "in winter"]  -->  target class "American vegetable"
input ["apple", "Peking", "in winter"]  -->  target class "Chinese fruit"
input ["tomato", "Peking", "in winter"]  -->  target class "Chinese vegetable"

Thank you.

$\endgroup$

2 Answers 2

1
$\begingroup$

You can leverage word-vector similarity in embedding models.

TL;DR similiar vectors of words (for example fruits) will be clustered together in this high (vector) dimensional space. For every possible class-set you will have a class-set representative (centroid) that is actually a key (so in your case fruit, vegetable etc) all you need to do is train/find a representative word embedding model of your corpus.

$\endgroup$
0
$\begingroup$

Use the segment embedding (idea from BERT) for the origin text classification model.

For example:

input ["apple", "Peking", "in summer"]  += segment emb [1,2,3,3,0]
input ["tomato", "New York", "in winter"] += segment emb [1,2,2,3,3]

where 1,2,3 are something like the data source type for input.

Another improvement: check out PCNN or PCNN+ATT

$\endgroup$
1

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.