# Which algorithm/api/approach to use to solve this task (and if even possible)?

I have some idea that I would like to test and I think the ML would be great solution. But I'm a little bit lost how it could be implemented.

The input is just a text, could be anything (but providing some information), for example "Cat has fur".

The output is an object. If it's presented in Json, could be for example the following:

{a: 'cat', b:'fur', c: {d: 'has'}}


This is only for example and doesn't have any sense. But the algorithm should be able to get set of training data (pairs text-object) and then generate new objects for the next text data (and ideally do the opposite task - to generate text based on objects).

How would you implement this one? Which algorithm/approaches could be used? Thanks!