【python爬虫】批量识别pdf中的英文,自动翻译成中文下

2023-09-09 10:28:11 浏览数 (2)

不管是上学还是上班,有时不可避免需要看英文文章,特别是在写毕业论文的时候。

比较头疼的是把专业性很强的英文pdf文章翻译成中文。

我记得我上学的时候,是一段一段复制,或者碰到不认识的单词就百度翻译一下,非常耗费时间。

英文好的请绕道

之前的文章提供了批量识别pdf中英文的方法,详见【python爬虫】批量识别pdf中的英文,自动翻译成中文上,本文实现自动pdf英文转中文文档。

本文目录

  1. 导入库
  2. 模拟登录百度翻译
  3. 翻译英文
  4. 把翻译语句定义成函数
  5. 把翻译后的内容输出到txt文档中

一、导入库

首先导入需要用到的库,如果有部分库还没安装,可以采用pip install的方法进行安装。

具体导入库的代码如下:

代码语言:javascript复制
import os 
import json
import time
import random
import pandas as pd
from captcha import * 
from datetime import datetime
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import wait
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
#导入库

这些库的主要作用是设置文件存放的位置,模拟人的操作进行爬虫,设置爬虫的间隔时间等。

代码语言:javascript复制

二、模拟登录百度翻译

代码语言:javascript复制
接着模拟登录百度翻译,具体代码如下:
代码语言:javascript复制
print('程序开始时间:', datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
options = webdriver.ChromeOptions()
options.add_argument("--disable-blink-features=AutomationControlled")  
browser = webdriver.Chrome(options=options)
browser.maximize_window()
login_url = 'https://fanyi.baidu.com/translate'
browser.get(login_url)
time.sleep(random.uniform(3, 5))
browser.implicitly_wait(20)
browser.find_element_by_xpath('//*[@id="desktop-guide-wrapper"]/div/div/div/a[2]').click()
主要函数解析如下:
login_url:填写待登录的网址。

time.sleep:设置休眠的时间。
browser.implicitly_wait:加载网页等待的时间。
代码语言:javascript复制


三、翻译英文

接着定义翻译英文的函数,具体代码如下: def fy_result(wd): wd= wd input_wd = browser.find_element_by_xpath('//*[@id="baidu_translate_input"]') input_wd.send_keys(Keys.CONTROL, 'a') input_wd.send_keys(Keys.CONTROL, 'x') input_wd.send_keys(wd) browser.find_element_by_xpath('//*[@id="translate-button"]').click() browser.implicitly_wait(5) result = browser.find_element_by_xpath('//*[@id="main-outer"]/div/div/div[1]/div[2]/div[1]/div[2]/div/div/div[1]/p[2]').text return result 接着输入待翻译的内容,然后调用函数输出翻译后的内容。 注意,本文中的wd和wd2是【python爬虫】批量识别pdf中的英文,自动翻译成中文上文章中识别的,murphy1996.pdf中的两页。 wd= ''' Medical and Pediatric Oncology 27:62-63 (1996) Ecthyma Gangrenosum Occurring at Sites of Iatrogenic Trauma in Pediatric Oncology Patients 0.M urphy, MB, BCh, BAO, MRCPI, P.J. Marsh, BSC, MB, ChB, MRCPath, s.1. j. Gray, MB, ChB, MRCP, MARCPath, Pedler, MB, ChB, MRCPath, and j. Kernahan, MB, BS, FRcP(Ed) DCH We report two cases of ecthyma gan- mary skin lesion. Both required prolonged grenosum which occurred at sites of iatro- courses of antibiotics and one patient died. genic trauma. The first case developed due The different pathogenic mechanisms and to metastatic seeding with Pseudornonas outcomes associated with this condition are aeruginosa during an episode of septicaemia discussed. 01996 Wiley-Liss, Inc. and the second case occurred as a pri- Key words: ecthyma gangrenosum, Pseudomonas aeruginosa, iatrogenic INTRODUCTION ate. No further lesions developed during the remainder of her treatment. Ecthyma gangrenosum (EG) is a well recognized cuta- neous manifestation of P.a eruginosa infections in immu- Case 2 nocompromised patients [ 11. We report two cases of EG A 13-month-old girl was admitted for investigation of occurring at sites of iatrogenic trauma in pediatric oncol- pancytopenia. A diagnosis of aplastic anaemia was made ogy patients and demonstrate important pathogenic and following left iliac crest marrow aspirate and trephine clinical features of this condition. bone biopsy. She became pyrexial on day 10 following admission but repeated blood cultures were negative. On day 24, a 1 cm2 sloughing necrotic area surrounded by CASE REPORTS purplish erythema was noted at the bone marrow Sam- pling site. At this time her Hb was 6.6 g/dl and WCC was Case 1 2.4 X 109/L( neutrophils 0.6 X 109/L). She was treated A 2-year-old girl with acute lymphoblastic leukaemia empirically with azlocillin and gentamicin. P. aerugi- was admitted with a fever, 2 weeks after a course of nma was isolated from the lesion swab and a diagnosis of chemotherapy which included intrathecal methotrexate. EG was made. Blood cultures remained sterile and radio- She was profoundly neutropenic (WCC 2.2 X lo9 /L, no logical examination did not reveal any evidence of bony neutrophils). Physical, examination revealed a swollen, involvement. Despite prolonged antibiotic and topical erythematous area with a central black eschar over the therapy, the iliac crest lesion failed to improve. On day lumbar puncture site. She was commenced empirically 32, she became pyrexial and Enterobacter sp. was iso- on imipenem-cilastatin and teicoplanin. Following isola- lated from two blood cultures. She was treated with intra- tion of P. aeruginosa from both blood cultures and lesion venous gentamicin and ciprofloxacin. Throughout her swab, a diagnosis of EG was made and therapy was illness she required numerous transfusions with platelets changed to ceftazidime and amikacin. Radiological as- and red blood cells. A suitable bone marrow donor could sessment of the lumbar spine did not reveal any evidence of bony involvement. She became apyrexial on day 3 as her neutropenia began to recover. She did not require From the Departments of Microbiology (O.M., P.J.M., J.G., S .J.P.), treatment with colony stimulating factors. Antimicrobials and Child Health (J.K.), Royal Victoria Infirmary, Newcastle upon were discontinued on day 17. Topical silver sulphadia- Tyne, UK. zine was continued for a further 4 weeks as the lesion Received April 6, 1995; accepted August 21, 1995 healed slowly by granulation from the base. Address reprint requests to 0. Murphy, M.B., B.Ch., B.A.O., For subsequent chemotherapy, high dose intravenous M.R.C.P.I., Department of Microbiology, Royal Victoria Infirmary, methotrexate was substituted for intrathecal methotrex- Queen Victoria Road, Newcastle upon Tyne NEl 4LP, UK. 0 1996 Wiley-Liss, Inc.1 ''' wd_split = wd.split(sep=".n") for i in range(len(wd_split)): one_j = wd_split[i].replace('n', ' ') print(one_j) print(fy_result(one_j)) 由于百度翻译一次只可以翻译1000个字符,而且换行空缺的字符也会统计,所以先把句子拆分,然后用空格替换句子中的换行符。 接着应用循环,逐句把英文翻译成中文。 也可以通过调整代码,把多句合并成一段话进行翻译。 由于程序中设计是5秒钟翻译一次,所以在量不是特别多的情况下,影响不大。 循环里先打印原始英文句子,再打印翻译后的中文,所以结果如下: Medical and Pediatric Oncology 27:62-63 (1996) Ecthyma Gangrenosum Occurring at Sites of Iatrogenic Trauma in Pediatric Oncology Patients 0.M urphy, MB, BCh, BAO, MRCPI, P.J. Marsh, BSC, MB, ChB, MRCPath, s.1 医学和儿科肿瘤学27:62-63(1996)儿童肿瘤学患者医源性创伤部位发生的坏疽性湿疹0。墨菲,MB,BCh,BAO,MRCPI,P.J.Marsh,BSC,MB,ChB,MRCPath,1 j. Gray, MB, ChB, MRCP, MARCPath, Pedler, MB, ChB, MRCPath, and j. Kernahan, MB, BS, FRcP(Ed) DCH We report two cases of ecthyma gan- mary skin lesion. Both required prolonged grenosum which occurred at sites of iatro- courses of antibiotics and one patient died j.Gray,MB,ChB,MRCP,MARCPath,Pedler,MB,ChB,MRCPath和j.Kernahan,MB,BS,FRcP(Ed)DCH我们报告了两例处女膜干皮肤病变。两种药物都需要长时间的grenosum,这种情况发生在抗生素疗程的部位,一名患者死亡 genic trauma. The first case developed due The different pathogenic mechanisms and to metastatic seeding with Pseudornonas outcomes associated with this condition are aeruginosa during an episode of septicaemia discussed. 01996 Wiley-Liss, Inc 源性创伤。第一个病例是由于败血症发作期间的铜绿假单胞菌引起的。01996 Wiley-Liss公司 and the second case occurred as a pri- Key words: ecthyma gangrenosum, Pseudomonas aeruginosa, iatrogenic INTRODUCTION ate. No further lesions developed during the remainder of her treatment 第二例主要发生在坏疽性脓疮、铜绿假单胞菌、医源性引言。在她的剩余治疗期间没有出现进一步的病变 Ecthyma gangrenosum (EG) is a well recognized cuta- neous manifestation of P.a eruginosa infections in immu- Case 2 nocompromised patients [ 11. We report two cases of EG A 13-month-old girl was admitted for investigation of occurring at sites of iatrogenic trauma in pediatric oncol- pancytopenia. A diagnosis of aplastic anaemia was made ogy patients and demonstrate important pathogenic and following left iliac crest marrow aspirate and trephine clinical features of this condition 坏疽性湿疹(EG)是一种公认的免疫病例2无功能患者中的P.a芥子病感染的新皮肤表现[11。我们报告了两例EG病例,一名13个月大的女孩因发生在儿童肿瘤-全血细胞减少症的医源性创伤部位而入院接受调查。诊断为再生障碍性贫血的患者,并证明了这种情况的重要致病性和随后的左髂嵴骨髓抽吸和环锯的临床特征 bone biopsy. She became pyrexial on day 10 following admission but repeated blood cultures were negative. On day 24, a 1 cm2 sloughing necrotic area surrounded by CASE REPORTS purplish erythema was noted at the bone marrow Sam- pling site. At this time her Hb was 6.6 g/dl and WCC was Case 1 2.4 X 109/L( neutrophils 0.6 X 109/L). She was treated A 2-year-old girl with acute lymphoblastic leukaemia empirically with azlocillin and gentamicin. P. aerugi- was admitted with a fever, 2 weeks after a course of nma was isolated from the lesion swab and a diagnosis of chemotherapy which included intrathecal methotrexate 骨活检。入院后第10天,她出现发热,但反复血液培养均为阴性。第24天,在骨髓Sam pling部位发现一个1cm2的脱落坏死区,周围有病例报告的紫色红斑。此时,她的Hb为6.6g/dl,WCC为病例1 2.4 X 109/L(中性粒细胞0.6 X 109/L)。她接受了阿洛西林和庆大霉素治疗一名患有急性淋巴细胞白血病的2岁女孩。在从病变拭子中分离出一个疗程的nma并诊断为化疗(包括鞘内甲氨蝶呤)后2周,P.aerugi因发烧入院 EG was made. Blood cultures remained sterile and radio- She was profoundly neutropenic (WCC 2.2 X lo9 /L, no logical examination did not reveal any evidence of bony neutrophils). Physical, examination revealed a swollen, involvement. Despite prolonged antibiotic and topical erythematous area with a central black eschar over the therapy, the iliac crest lesion failed to improve. On day lumbar puncture site. She was commenced empirically 32, she became pyrexial and Enterobacter sp. was iso- on imipenem-cilastatin and teicoplanin. Following isola- lated from two blood cultures. She was treated with intra- tion of P. aeruginosa from both blood cultures and lesion venous gentamicin and ciprofloxacin. Throughout her swab, a diagnosis of EG was made and therapy was illness she required numerous transfusions with platelets changed to ceftazidime and amikacin. Radiological as- and red blood cells. A suitable bone marrow donor could sessment of the lumbar spine did not reveal any evidence of bony involvement. She became apyrexial on day 3 as her neutropenia began to recover. She did not require From the Departments of Microbiology (O.M., P.J.M., J.G., S .J.P.), treatment with colony stimulating factors. Antimicrobials and Child Health (J.K.), Royal Victoria Infirmary, Newcastle upon were discontinued on day 17. Topical silver sulphadia- Tyne, UK EG制成。血液培养物保持无菌和放射性-她严重中性粒细胞减少(WCC 2.2 X lo9/L,没有任何逻辑检查显示任何骨中性粒细胞的证据)。体格检查显示有肿胀、受累。尽管在治疗过程中抗生素使用时间延长,局部红斑区域出现中央黑色焦痂,但髂嵴病变未能改善。日间腰椎穿刺部位。她从32岁开始,开始发热,肠杆菌属对亚胺培南-西司他丁和替考拉宁产生耐药性。从两种血液培养物中分离出来。她接受了来自血液培养和病变静脉的铜绿假单胞菌庆大霉素和环丙沙星的注射治疗。在她的拭子检查中,诊断为EG,治疗是一种疾病,她需要多次输注血小板,换成头孢他啶和阿米卡星。放射性as和红细胞。合适的骨髓捐献者可以对腰椎进行评估,但没有发现任何骨髓移植的证据 zine was continued for a further 4 weeks as the lesion Received April 6, 1995; accepted August 21, 1995 healed slowly by granulation from the base 随着病变于1995年4月6日接收,zine继续治疗4周;1995年8月21日接受治疗,通过基底肉芽慢慢愈合 Address reprint requests to 0. Murphy, M.B., B.Ch., B.A.O., For subsequent chemotherapy, high dose intravenous M.R.C.P.I., Department of Microbiology, Royal Victoria Infirmary, methotrexate was substituted for intrathecal methotrex- Queen Victoria Road, Newcastle upon Tyne NEl 4LP, UK 将重新打印请求地址发送到0。Murphy,M.B.,B.Ch.,B.A.O.,对于随后的化疗,大剂量静脉注射M.R.C.P.I.,皇家维多利亚医院微生物学系,甲氨蝶呤替代鞘内甲氨蝶啶-英国泰恩河畔纽卡斯尔维多利亚女王路NEl 4LP 0 1996 Wiley-Liss, Inc.1 0 1996 Wiley-Liss公司1 四、把翻译语句定义成函数

接着输入另一页待翻译的内容,用定义好的翻译函数进行翻译,代码如下: wd2 = ''' EG at Sites of Iatrogenic Trauma 63 not be found. A 2-week course of GMCSF was started on In case 1, we believe that seeding to an area of trauma- day 53 but no improvement in her haematological param- tised skin occurred during bacteraemia. Early recognition eters was seen and her general condition continued to and aggressive treatment may have played a role in con- deteriorate. On day 85, she again became pyrexial and a trolling the primary septicaemia but recovery of the pa- 1. O X 1.5 cm ulcer on her right labium majus was noted. tient’s bone marrow probably contributed more to the Her WCC was 0.4 X 109/L. P. aeruginosa was isolated long-term outcome. In case 2, repeated negative blood from blood cultures for the first time. Despite aggressive cultures suggest that EG occurred as a primary lesion at a antibiotic and antifungal treatment, further lesions devel- site of prior skin trauma. Despite aggressive treatment, oped on her face and chest and she subsequently died. persistent profound neutropenia was associated with fail- ure of the lesion to resolve and the development of a secondary bacteraemia and further lesions. DISCUSSION Paediatric oncology patients are frequently subject to Although not pathognomic, ecthyma gangrenosum is a invasive procedures involving minor skin trauma which well recognised manifestation of P. aeruginosa infection may predispose them to infection with various organisms in immunocompromised patients. Factors such as neutro- including P. aeruginosa. EG is an extremely difficult penia, use of bread spectrum antibiotics, loss of skin condition to treat and a high index of suspicion in this integrity, and moist conditions have been shown to pre- at-risk population is required to ensure early diagnosis dispose to infection with P. aeruginosa and the develop- and optimum treatment. ment of EG [2]. Two possible pathogenic mechanisms in the development of this condition have been postulated [2,3]. In classic or bacteraemic EG, the lesion is consid- ered to represent blood-borne metastatic seeding of P. aeruginosa to the skin. In non-bacteraemic or primary REFERENCES EG, the lesion is located at the site of entry of the organ- 1. Dorff GJ, Geimer NF, Rosenthal DR, et al.: Pseudornonas septice- ism into the skin. In these cases the lesions have been mia: illustrated evolution of its skin lesions. Arch Intern Med 128: found to occur more commonly in the distribution of 591, 1971. exocrine glands and secondary bacteraemia has rarely 2 El Baze P, Thyss A, Vinti H, Deville A, Dellamonica P, Ortonne been reported. Early diagnosis and aggressive therapy are J-P: A study of nineteen immunocompromised patients with exten- sive skin lesions caused by Pseudomonas aeruginosa with and important in the management of these patients. Although without bacteraemia. Acta Derm Venereol (Stockh) 71:411-415, patients with non-bacteraemic lesions have generally 1991. been found to have a better prognosis than those with 3. Huminer D, Siegman-Igra Y, Morduchowicz G, Pitlik SD: Ec- bacteraemic EG [3,4], our experience of survival ulti- thyma gangrenosum without bacteraemia. Report of six cases and a mately being determined by recovery of neutrophils con- review of the literature. Arch Intern Med 147:299-301, 1987. 4. Fergie JE, Patrick CP, Lott L: Pseudomonas aeruginosa cellulitis firms that of others [5]. and ecthyma gangrenosum in imrnunocompromised children. Pedi- To our knowledge, these are the first reports of EG atr Infect Dis J 10:496-500, 1991. occurring at sites of iatrogenic trauma in paediatric oncol- 5. Greene SL, Daniel Su WP, Muller SA: Ecthyma gangrenosurn: ogy patients. The only previous report was in an adult report of clinical, histopathologic, and bacteriologic aspects of with AML who developed EG at the site of placement of eight cases. J Am Acad Dermatol 11:781-787, 1984. 6. Klepflish A, Bembi A. Ecthyma gangrenosum caused by a roving an ECG electrode [6]. In this case, skin trauma coincided chest electrode in an acute myeloid leukaemia patient with with a documented P. aeruginosa septicaemia and meta- Pseudomonas septicaemia [Letterl. J Am Acad Dermatol 18585- static seeding was felt to have occurred. 586, 1988. ''' def wd_split_f(wd): try: wd = wd wd_split = wd.split(sep=".n") chin_f = [] for i in range(len(wd_split)): one_e = wd_split[i].replace('n', ' ') one_c = fy_result(one_e) print(wd_split[i]) print(one_c) chin_f.append(one_c) except: pass return chin_f chin_f = wd_split_f(wd2) 得到结果1: EG at Sites of Iatrogenic Trauma 63 not be found. A 2-week course of GMCSF was started on In case 1, we believe that seeding to an area of trauma- day 53 but no improvement in her haematological param- tised skin occurred during bacteraemia. Early recognition eters was seen and her general condition continued to and aggressive treatment may have played a role in con- deteriorate. On day 85, she again became pyrexial and a trolling the primary septicaemia but recovery of the pa- 1. O X 1.5 cm ulcer on her right labium majus was noted. tient’s bone marrow probably contributed more to the Her WCC was 0.4 X 109/L. P. aeruginosa was isolated long-term outcome. In case 2, repeated negative blood from blood cultures for the first time. Despite aggressive cultures suggest that EG occurred as a primary lesion at a antibiotic and antifungal treatment, further lesions devel- site of prior skin trauma. Despite aggressive treatment, oped on her face and chest and she subsequently died. persistent profound neutropenia was associated with fail- ure of the lesion to resolve and the development of a secondary bacteraemia and further lesions 未发现医源性创伤63处的EG。病例1开始接受为期2周的GMCSF治疗。我们认为,在菌血症期间,接种到创伤区域(第53天),但她的血液学参数皮肤没有改善。早期发现了eters,她的一般情况仍在继续,积极的治疗可能在病情恶化中起到了一定作用。第85天,她再次出现发热和原发性败血症,但pa-1已经康复。她右侧大阴唇有O×1.5厘米的溃疡。患者骨髓对Her WCC的贡献可能更大,为0.4X109/L。铜绿假单胞菌是分离的长期结果。在病例2中,首次从血液培养物中重复阴性血液。尽管侵袭性培养表明EG在抗生素和抗真菌治疗中是原发性病变,但进一步的病变发展为先前皮肤创伤的部位。尽管进行了积极的治疗,她还是对自己的面部和胸部进行了手术,随后死亡。持久的 DISCUSSION Paediatric oncology patients are frequently subject to Although not pathognomic, ecthyma gangrenosum is a invasive procedures involving minor skin trauma which well recognised manifestation of P. aeruginosa infection may predispose them to infection with various organisms in immunocompromised patients. Factors such as neutro- including P. aeruginosa. EG is an extremely difficult penia, use of bread spectrum antibiotics, loss of skin condition to treat and a high index of suspicion in this integrity, and moist conditions have been shown to pre- at-risk population is required to ensure early diagnosis dispose to infection with P. aeruginosa and the develop- and optimum treatment 讨论儿科肿瘤学患者经常遭受坏疽性脓疮的侵袭,尽管不是病理性的,但这是一种涉及轻微皮肤创伤的侵入性手术,公认的铜绿假单胞菌感染表现可能使他们容易感染免疫功能低下患者的各种生物。中性粒细胞等因素-包括铜绿假单胞菌。EG是一种极其困难的减少症,使用面包谱抗生素,需要治疗皮肤状况的丧失和对这种完整性的高度怀疑,并且已经向高危人群证明,需要潮湿的条件来确保早期诊断,处理铜绿假单胞菌感染,并发展和优化治疗 ment of EG [2]. Two possible pathogenic mechanisms in the development of this condition have been postulated [2,3]. In classic or bacteraemic EG, the lesion is consid- ered to represent blood-borne metastatic seeding of P EG[2]。在这种情况的发展过程中,已经假设了两种可能的致病机制[2,3]。在经典或细菌性EG中,病变被认为代表P的血源性转移种子 aeruginosa to the skin. In non-bacteraemic or primary REFERENCES EG, the lesion is located at the site of entry of the organ- 1. Dorff GJ, Geimer NF, Rosenthal DR, et al.: Pseudornonas septice- ism into the skin. In these cases the lesions have been mia: illustrated evolution of its skin lesions. Arch Intern Med 128: found to occur more commonly in the distribution of 591, 1971 铜绿假单胞菌附着在皮肤上。在非细菌性或原发性参考文献EG中,病变位于器官进入部位-1。Dorff GJ,Geimer NF,Rosenthal DR等:皮肤中的假海绵体败血症。在这些病例中,病变是mia:说明了其皮肤病变的演变。Arch Intern Med 128:发现更常见于5911971年的分布 exocrine glands and secondary bacteraemia has rarely 2 El Baze P, Thyss A, Vinti H, Deville A, Dellamonica P, Ortonne been reported. Early diagnosis and aggressive therapy are J-P: A study of nineteen immunocompromised patients with exten- sive skin lesions caused by Pseudomonas aeruginosa with and important in the management of these patients. Although without bacteraemia. Acta Derm Venereol (Stockh) 71:411-415, patients with non-bacteraemic lesions have generally 1991 外分泌腺和继发性菌血症很少有2 El Baze P、Thyss A、Vinti H、Deville A、Dellamonica P、Ortonne的报道。早期诊断和积极治疗是J-P:一项对19名免疫功能低下的铜绿假单胞菌引起的广泛皮肤损伤患者的研究,对这些患者的管理很重要。虽然没有菌血症。Acta Derm Venereol(Stockh)71:411-415,非细菌性病变患者通常在1991年 been found to have a better prognosis than those with 3. Huminer D, Siegman-Igra Y, Morduchowicz G, Pitlik SD: Ec- bacteraemic EG [3,4], our experience of survival ulti- thyma gangrenosum without bacteraemia. Report of six cases and a mately being determined by recovery of neutrophils con- review of the literature. Arch Intern Med 147:299-301, 1987 发现其预后比3。Huminer D,Siegman-Igra Y,Morduchowicz G,Pitlik SD:Ec-菌血症EG[3,4],我们在没有菌血症的情况下存活多发性坏疽性胸腺的经验。报告6例病例和1例由中性粒细胞恢复确定的病例——文献综述。Arch Intern Med 147:299-301987 4. Fergie JE, Patrick CP, Lott L: Pseudomonas aeruginosa cellulitis firms that of others [5] 4.Fergie JE,Patrick CP,Lott L:铜绿假单胞菌蜂窝组织炎与其他细菌的蜂窝组组织炎相当[5] and ecthyma gangrenosum in imrnunocompromised children. Pedi- To our knowledge, these are the first reports of EG atr Infect Dis J 10:496-500, 1991 未受损儿童的坏疽性脓疮。Pedi-据我们所知,这些是EG atr Infect Dis J 10:496-5001991的首次报道 occurring at sites of iatrogenic trauma in paediatric oncol- 5. Greene SL, Daniel Su WP, Muller SA: Ecthyma gangrenosurn: ogy patients. The only previous report was in an adult report of clinical, histopathologic, and bacteriologic aspects of with AML who developed EG at the site of placement of eight cases. J Am Acad Dermatol 11:781-787, 1984 发生在儿童肿瘤的医源性创伤部位。Greene SL,Daniel Su WP,Muller SA:坏疽性湿疹患者。此前唯一的报告是一份成人AML的临床、组织病理学和细菌学方面的报告,该报告在8例病例的植入部位出现EG。美国皮肤病学会杂志11:781-7871984 6. Klepflish A, Bembi A. Ecthyma gangrenosum caused by a roving an ECG electrode [6]. In this case, skin trauma coincided chest electrode in an acute myeloid leukaemia patient with with a documented P. aeruginosa septicaemia and meta- Pseudomonas septicaemia [Letterl. J Am Acad Dermatol 18585- static seeding was felt to have occurred. 586, 1988 6.Klepflish A,Bembi A.由心电图电极巡回引起的坏疽性湿疹[6]。在这种情况下,一名患有铜绿假单胞菌败血症和间假单胞菌败血病的急性髓系白血病患者的皮肤创伤与胸部电极一致[Lettel.J Am Acad Dermatol 18585-感觉发生了静态接种。5861988 得到结果2(chin_f): ['未发现医源性创伤63处的EG。病例1开始接受为期2周的GMCSF治疗。我们认为,在菌血症期间,接种到创伤区域(第53天),但她的血液学参数皮肤没有改善。早期发现了eters,她的一般情况仍在继续,积极的治疗可能在病情恶化中起到了一定作用。第85天,她再次出现发热和原发性败血症,但pa-1已经康复。她右侧大阴唇有O×1.5厘米的溃疡。患者骨髓对Her WCC的贡献可能更大,为0.4X109/L。铜绿假单胞菌是分离的长期结果。在病例2中,首次从血液培养物中重复阴性血液。尽管侵袭性培养表明EG在抗生素和抗真菌治疗中是原发性病变,但进一步的病变发展为先前皮肤创伤的部位。尽管进行了积极的治疗,她还是对自己的面部和胸部进行了手术,随后死亡。持久的', '讨论儿科肿瘤学患者经常遭受坏疽性脓疮的侵袭,尽管不是病理性的,但这是一种涉及轻微皮肤创伤的侵入性手术,公认的铜绿假单胞菌感染表现可能使他们容易感染免疫功能低下患者的各种生物。中性粒细胞等因素-包括铜绿假单胞菌。EG是一种极其困难的减少症,使用面包谱抗生素,需要治疗皮肤状况的丧失和对这种完整性的高度怀疑,并且已经向高危人群证明,需要潮湿的条件来确保早期诊断,处理铜绿假单胞菌感染,并发展和优化治疗', 'EG[2]。在这种情况的发展过程中,已经假设了两种可能的致病机制[2,3]。在经典或细菌性EG中,病变被认为代表P的血源性转移种子', '铜绿假单胞菌附着在皮肤上。在非细菌性或原发性参考文献EG中,病变位于器官进入部位-1。Dorff GJ,Geimer NF,Rosenthal DR等:皮肤中的假海绵体败血症。在这些病例中,病变是mia:说明了其皮肤病变的演变。Arch Intern Med 128:发现更常见于5911971年的分布', '外分泌腺和继发性菌血症很少有2 El Baze P、Thyss A、Vinti H、Deville A、Dellamonica P、Ortonne的报道。早期诊断和积极治疗是J-P:一项对19名免疫功能低下的铜绿假单胞菌引起的广泛皮肤损伤患者的研究,对这些患者的管理很重要。虽然没有菌血症。Acta Derm Venereol(Stockh)71:411-415,非细菌性病变患者通常在1991年', '发现其预后比3。Huminer D,Siegman-Igra Y,Morduchowicz G,Pitlik SD:Ec-菌血症EG[3,4],我们在没有菌血症的情况下存活多发性坏疽性胸腺的经验。报告6例病例和1例由中性粒细胞恢复确定的病例——文献综述。Arch Intern Med 147:299-301987', '4.Fergie JE,Patrick CP,Lott L:铜绿假单胞菌蜂窝组织炎与其他细菌的蜂窝组组织炎相当[5]', '未受损儿童的坏疽性脓疮。Pedi-据我们所知,这些是EG atr Infect Dis J 10:496-5001991的首次报道', '发生在儿童肿瘤的医源性创伤部位。Greene SL,Daniel Su WP,Muller SA:坏疽性湿疹患者。此前唯一的报告是一份成人AML的临床、组织病理学和细菌学方面的报告,该报告在8例病例的植入部位出现EG。美国皮肤病学会杂志11:781-7871984', '6.Klepflish A,Bembi A.由心电图电极巡回引起的坏疽性湿疹[6]。在这种情况下,一名患有铜绿假单胞菌败血症和间假单胞菌败血病的急性髓系白血病患者的皮肤创伤与胸部电极一致[Lettel.J Am Acad Dermatol 18585-感觉发生了静态接种。5861988'] 五、把翻译后的内容输出到txt文档中

要想把翻译后的结果输出到txt文档中,首先把chin_f中的内容拼接到一起,代码如下: chin_f_str = chin_f[0] for i in range(1, len(chin_f)): chin_f_str = chin_f_str '。n' chin_f[i] print(chin_f_str) 得到结果: 未发现医源性创伤63处的EG。病例1开始接受为期2周的GMCSF治疗。我们认为,在菌血症期间,接种到创伤区域(第53天),但她的血液学参数皮肤没有改善。早期发现了eters,她的一般情况仍在继续,积极的治疗可能在病情恶化中起到了一定作用。第85天,她再次出现发热和原发性败血症,但pa-1已经康复。她右侧大阴唇有O×1.5厘米的溃疡。患者骨髓对Her WCC的贡献可能更大,为0.4X109/L。铜绿假单胞菌是分离的长期结果。在病例2中,首次从血液培养物中重复阴性血液。尽管侵袭性培养表明EG在抗生素和抗真菌治疗中是原发性病变,但进一步的病变发展为先前皮肤创伤的部位。尽管进行了积极的治疗,她还是对自己的面部和胸部进行了手术,随后死亡。持久的。 讨论儿科肿瘤学患者经常遭受坏疽性脓疮的侵袭,尽管不是病理性的,但这是一种涉及轻微皮肤创伤的侵入性手术,公认的铜绿假单胞菌感染表现可能使他们容易感染免疫功能低下患者的各种生物。中性粒细胞等因素-包括铜绿假单胞菌。EG是一种极其困难的减少症,使用面包谱抗生素,需要治疗皮肤状况的丧失和对这种完整性的高度怀疑,并且已经向高危人群证明,需要潮湿的条件来确保早期诊断,处理铜绿假单胞菌感染,并发展和优化治疗。 EG[2]。在这种情况的发展过程中,已经假设了两种可能的致病机制[2,3]。在经典或细菌性EG中,病变被认为代表P的血源性转移种子。 铜绿假单胞菌附着在皮肤上。在非细菌性或原发性参考文献EG中,病变位于器官进入部位-1。Dorff GJ,Geimer NF,Rosenthal DR等:皮肤中的假海绵体败血症。在这些病例中,病变是mia:说明了其皮肤病变的演变。Arch Intern Med 128:发现更常见于5911971年的分布。 外分泌腺和继发性菌血症很少有2 El Baze P、Thyss A、Vinti H、Deville A、Dellamonica P、Ortonne的报道。早期诊断和积极治疗是J-P:一项对19名免疫功能低下的铜绿假单胞菌引起的广泛皮肤损伤患者的研究,对这些患者的管理很重要。虽然没有菌血症。Acta Derm Venereol(Stockh)71:411-415,非细菌性病变患者通常在1991年。 发现其预后比3。Huminer D,Siegman-Igra Y,Morduchowicz G,Pitlik SD:Ec-菌血症EG[3,4],我们在没有菌血症的情况下存活多发性坏疽性胸腺的经验。报告6例病例和1例由中性粒细胞恢复确定的病例——文献综述。Arch Intern Med 147:299-301987。 4.Fergie JE,Patrick CP,Lott L:铜绿假单胞菌蜂窝组织炎与其他细菌的蜂窝组组织炎相当[5]。 未受损儿童的坏疽性脓疮。Pedi-据我们所知,这些是EG atr Infect Dis J 10:496-5001991的首次报道。 发生在儿童肿瘤的医源性创伤部位。Greene SL,Daniel Su WP,Muller SA:坏疽性湿疹患者。此前唯一的报告是一份成人AML的临床、组织病理学和细菌学方面的报告,该报告在8例病例的植入部位出现EG。美国皮肤病学会杂志11:781-7871984。 6.Klepflish A,Bembi A.由心电图电极巡回引起的坏疽性湿疹[6]。在这种情况下,一名患有铜绿假单胞菌败血症和间假单胞菌败血病的急性髓系白血病患者的皮肤创伤与胸部电极一致[Lettel.J Am Acad Dermatol 18585-感觉发生了静态接种。5861988 然后在文件夹中新建一个txt文件,把合并后的内容写入到txt文件中。具体代码如下: os.chdir(r'G:python24_pdf英文转中文txt') file = open('chinese.txt', 'w') file.write(chin_f_str) file.close() 本文的代码起到一个抛砖引玉的作用,大家可以根据需要自行调整代码。具体方向如下:

  • 1.把单句合并成多句输入翻译函数。
  • 2.把txt文档换成doc文档。
  • 3.输出到文档中的内容由纯中文,变成一句英文一句中文。
  • 4.和识别pdf文章结合,写循环一次把所有文章翻译出来,并生成对应的中文文档。
  • 5.把代码转换成html文档,让没有安装python的小伙伴也可以使用。

至此,Python识别pdf中英文并转化成中文已讲解完毕,需要的朋友可以自己跟着代码尝试一遍

一文囊括Python中的函数,持续更新。。。

一文囊括Python中的有趣案例,持续更新。。。

一文囊括Python中的数据分析与绘图,持续更新。。。

一文囊括风控模型搭建(原理 Python实现),持续更新。。。

0 人点赞