I'm new to ML, so if it seems like I am making incorrect assumptions on how to go about doing something, please feel free to correct me.
I would like to be able to pass in as training data many emails as text files and the features (output) that should be extracted from those files. Most of the emails specific formatting will be very different. However, they will all contain the same basic data that I want to extract.
An example email would be of a receipt for some product or service you signed up for, saying something like "We have charged X amount to your credit card... This bill is for 8-22-17 - 9-22-17...". I would want to be able to extract the amount you were charged for, the currency, an invoice/receipt id, the plan interval for what you are paying (month, year, etc.), and plan type (basic, premium, etc.).
Is there a way with some library (preferably some Javascript/Node library or Tensor Flow) to pass in the expected output, say as a JSON object where the keys are the names of the features I would like to extract and the values are the extracted values?
For example, if the email is a receipt, I would like to be able pass in the features:
{
PRICE: 100,
CURRENCY: "USD",
}
so I'm telling the algorithm that the price is 100 and the currency is USD for that particular email.
What I would like is that the algorithm should return an object as output for a new email passed in and be capable of finding and setting on the object the price and currency.
I know I am talking very specific with JSON, so if there is another way to do it that doesn't involve JSON that is fine.
Ultimately, what library and algorithm would be appropriate to solve my problem?
Thank you!