To understand this project proposal, please do the following steps.
1. Go here: [login to view URL]
2. Open DevTools in Chrome and go to Network.
3. then on the translator site, press 'Translate and Compare'
4. Click on either of the 'Is this Better?' buttons
5. Then (in DevTools) click 'translate'
6. Go to Preview on the top right of 'translate'
You'll see something like:
resultNMT: "Judging from the market performance, the RMB exchange rate has a clear two-way floating characteristic, the exchange rate elasticity strengthens, The exchange rate expectation overall Stable."
resultResearch: "Judging from the market performance, over the past year, the RMB exchange rate has obvious characteristics of two-way floating, the exchange rate flexibility has increased, and the exchange rate is expected to be stable overall."
I have included a postman script which demonstrates that this works as a Rest API call.
I want the same thing to be done via Python script.
So, the result I want is a python script which will take as an input a txt file; it will input each LINE of that file (I will tokenize myself; just take each linebreak as a token);
Then, the output will be simply another txt which is LINE1 of original and underneath resultResearch. And so on for every line of the original input.