Can I do something like this in python? I have 3 sentences:
I like cats.
I like cats
I like cats
And it is possible when I give I like, the script returns cats?
Can somebody give me advice/tool or some example?
Can I do something like this in python? I have 3 sentences:
I like cats.
I like cats
I like cats
And it is possible when I give I like, the script returns cats?
Can somebody give me advice/tool or some example?
There are an unlimited number of ways to do that. You could make a script that just does this:
print("cats")
But, I don't think that's what you want. You're looking for a Language Model. Again, there are many ways of doing this, from the fairly simple Bayesian model to a more advanced neural network language model. If you want to build your own, I would recommend checking out TensorFlow's tutorial on language models. Otherwise, you could use something that's a bit more off the shelf, such as NLTK's language model (see example here).