In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
The knowledge of this article "how to use Python to achieve a paper weight reduction tool" is not understood by most people, so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to use Python to achieve a paper weight reduction tool" article.
First of all, you need to enter appid and key, which can apply for an account on the Baidu translation open platform, and you can apply for an account for free. Then copy the text content that needs to be reduced to the corresponding input box, click the start button, you can output different sentences with similar meaning, that is, to reduce the weight and remove the weight. Click the copy button to copy the new text to the clipboard, click the clear button to re-enter the text that needs to be reduced, and cycle through it.
Weight removal principle
The granularity of checking weight in a paper is a sentence, and the similarity between two sentences mainly depends on which words the sentence contains and the position of the words in the sentence. Sentence similarity is only a textual comparison, regardless of semantic similarity.
For this reason, the measure we can take is to change the sentence structure and replace it with similar words.
In order to complete the automatic replacement of these sentences, so as to achieve the purpose of reducing weight, it is easy to think of using the conversion between different languages to generate new text. For example, in this tool, I use the Chinese → English → Korean → Chinese strategy, you can also take a longer conversion path, but that seems to greatly reduce the readability of the text.
The use of open platforms
Sentence translation I use the Baidu translation open platform interface, after a simple application can get 2 million per month free character translation rights.
The access method of this API is slightly troublesome, which requires generating a signature sign and stitching a complete url.
Def translate: url = 'http://api.fanyi.baidu.com/api/trans/vip/translate' salt = random.randint (1, 65536) sign = hashlib.md5 ((str (appid) + str (Q) + str (salt) + str (key)). Encode (' utf-8')). Hexdigest () params = {'from': lan_from,' to': lan_to 'salt': salt,' sign': sign, 'appid': appid,' qflux: Q} r = requests.get (url,params=params) txt = r.json () if txt.get ('trans_result' -1) =-1: print ('ERROR Code: {}' .format (txt)) return q return txt ['trans_result'] [0] [' dst'] above is the content of this article on "how to use Python to implement a paper weight reduction tool" I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.