为什么我没有足够的值来解包(预期3,得到1)复杂的列表理解

2024-06-24 12:31:41 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在努力理解列表,但我不知道如何处理它。我想我理解这个问题,但我想保持我的乐观态度。
extract_entities(content)返回由3个元素组成的元组列表

[result_file_ner.write(convert_format(f'{name}\t{tag}\t{ner}\n', pos_table)) 
 for name, tag, ner in zip(*[iter(extract_entities(content))])]

如何更改此列表以保持一行? 事实上,为了工作我必须这样做,但我不确定这是否是一个好方法

list(map(lambda x: print(x) , zip(*[iter(extract_entities(content))]))) 

给予

([('Consuela', 'NNP', 'B-PERSON'), ('Washington', 'NNP', 'B-ORGANIZATION'), (',', ',', 'O'), ('a', 'DT', 'O'), ('longtime', 'JJ', 'O'), ('House', 'NNP', 'B-ORGANIZATION'), ('staffer', 'NN', 'O'), ('and', 'CC', 'O'), ('an', 'DT', 'O'), ('expert', 'NN', 'O'), ('in', 'IN', 'O'), ('securities', 'NNS', 'O'), ('laws', 'NNS', 'O'), (',', ',', 'O'), ('is', 'VBZ', 'O'), ('a', 'DT', 'O'), ('leading', 'VBG', 'O'), ('candidate', 'NN', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('chairwoman', 'NN', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('Securities', 'NNPS', 'B-ORGANIZATION'), ('and', 'CC', 'O'), ('Exchange', 'NNP', 'B-ORGANIZATION'), ('Commission', 'NNP', 'I-ORGANIZATION'), ('in', 'IN', 'O'), ('the', 'DT', 'O'), ('Clinton', 'NNP', 'B-PERSON'), ('administration', 'NN', 'O'), ('.', '.', 'O')],)
([('Ms.', 'NNP', 'O'), ('Washington', 'NNP', 'B-GPE'), (',', ',', 'O'), ('44', 'CD', 'O'), ('years', 'NNS', 'O'), ('old', 'JJ', 'O'), (',', ',', 'O'), ('would', 'MD', 'O'), ('be', 'VB', 'O'), ('the', 'DT', 'O'), ('first', 'JJ', 'O'), ('woman', 'NN', 'O'), ('and', 'CC', 'O'), ('the', 'DT', 'O'), ('first', 'JJ', 'O'), ('black', 'JJ', 'O'), ('to', 'TO', 'O'), ('head', 'VB', 'O'), ('the', 'DT', 'O'), ('five-member', 'JJ', 'O'), ('commission', 'NN', 'O'), ('that', 'WDT', 'O'), ('oversees', 'VBZ', 'O'), ('the', 'DT', 'O'), ('securities', 'NNS', 'O'), ('markets', 'NNS', 'O'), ('.', '.', 'O')],)
([('Ms.', 'NNP', 'O'), ('Washington', 'NNP', 'B-GPE'), ("'s", 'POS', 'O'), ('candidacy', 'NN', 'O'), ('is', 'VBZ', 'O'), ('being', 'VBG', 'O'), ('championed', 'VBN', 'O'), ('by', 'IN', 'O'), ('several', 'JJ', 'O'), ('powerful', 'JJ', 'O'), ('lawmakers', 'NNS', 'O'), ('including', 'VBG', 'O'), ('her', 'PRP$', 'O'), ('boss', 'NN', 'O'), (',', ',', 'O'), ('Chairman', 'NNP', 'B-PERSON'), ('John', 'NNP', 'B-PERSON'), ('Dingell', 'NNP', 'I-PERSON'), ('(', '(', 'O'), ('D.', 'NNP', 'O'), (',', ',', 'O'), ('Mich.', 'NNP', 'O'), (')', ')', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('House', 'NNP', 'B-ORGANIZATION'), ('Energy', 'NNP', 'I-ORGANIZATION'), ('and', 'CC', 'O'), ('Commerce', 'NNP', 'B-ORGANIZATION'), ('Committee', 'NNP', 'I-ORGANIZATION'), ('.', '.', 'O')],)
([('She', 'PRP', 'O'), ('currently', 'RB', 'O'), ('is', 'VBZ', 'O'), ('a', 'DT', 'O'), ('counsel', 'NN', 'O'), ('to', 'TO', 'O'), ('the', 'DT', 'O'), ('committee', 'NN', 'O'), ('.', '.', 'O')],)
([('Ms.', 'NNP', 'O'), ('Washington', 'NNP', 'B-GPE'), ('and', 'CC', 'O'), ('Mr.', 'NNP', 'B-PERSON'), ('Dingell', 'NNP', 'I-PERSON'), ('have', 'VBP', 'O'), ('been', 'VBN', 'O'), ('considered', 'VBN', 'O'), ('allies', 'NNS', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('securities', 'NNS', 'O'), ('exchanges', 'NNS', 'O'), (',', ',', 'O'), ('while', 'IN', 'O'), ('banks', 'NNS', 'O'), ('and', 'CC', 'O'), ('futures', 'NNS', 'O'), ('exchanges', 'NNS', 'O'), ('have', 'VBP', 'O'), ('often', 'RB', 'O'), ('fought', 'VBN', 'O'), ('with', 'IN', 'O'), ('them', 'PRP', 'O'), ('.', '.', 'O')],)
([('A', 'DT', 'O'), ('graduate', 'NN', 'O'), ('of', 'IN', 'O'), ('Harvard', 'NNP', 'B-ORGANIZATION'), ('Law', 'NNP', 'I-ORGANIZATION'), ('School', 'NNP', 'I-ORGANIZATION'), (',', ',', 'O'), ('Ms.', 'NNP', 'O'), ('Washington', 'NNP', 'B-GPE'), ('worked', 'VBD', 'O'), ('as', 'IN', 'O'), ('a', 'DT', 'O'), ('laywer', 'NN', 'O'), ('for', 'IN', 'O'), ('the', 'DT', 'O'), ('corporate', 'JJ', 'O'), ('finance', 'NN', 'O'), ('division', 'NN', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('SEC', 'NNP', 'B-ORGANIZATION'), ('in', 'IN', 'O'), ('the', 'DT', 'O'), ('late', 'JJ', 'O'), ('1970s', 'NNS', 'O'), ('.', '.', 'O')],)
([('She', 'PRP', 'O'), ('has', 'VBZ', 'O'), ('been', 'VBN', 'O'), ('a', 'DT', 'O'), ('congressional', 'JJ', 'O'), ('staffer', 'NN', 'O'), ('since', 'IN', 'O'), ('1979', 'CD', 'O'), ('.', '.', 'O')],)
([('Separately', 'RB', 'O'), (',', ',', 'O'), ('Clinton', 'NNP', 'B-PERSON'), ('transition', 'NN', 'O'), ('officials', 'NNS', 'O'), ('said', 'VBD', 'O'), ('that', 'IN', 'O'), ('Frank', 'NNP', 'B-PERSON'), ('Newman', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('50', 'CD', 'O'), (',', ',', 'O'), ('vice', 'NN', 'O'), ('chairman', 'NN', 'O'), ('and', 'CC', 'O'), ('chief', 'JJ', 'O'), ('financial', 'JJ', 'O'), ('officer', 'NN', 'O'), ('of', 'IN', 'O'), ('BankAmerica', 'NNP', 'B-ORGANIZATION'), ('Corp.', 'NNP', 'I-ORGANIZATION'), (',', ',', 'O'), ('is', 'VBZ', 'O'), ('expected', 'VBN', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('nominated', 'VBN', 'O'), ('as', 'IN', 'O'), ('assistant', 'JJ', 'O'), ('Treasury', 'NNP', 'B-ORGANIZATION'), ('secretary', 'NN', 'O'), ('for', 'IN', 'O'), ('domestic', 'JJ', 'O'), ('finance', 'NN', 'O'), ('.', '.', 'O')],)
([('Mr.', 'NNP', 'B-PERSON'), ('Newman', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('who', 'WP', 'O'), ('would', 'MD', 'O'), ('be', 'VB', 'O'), ('giving', 'VBG', 'O'), ('up', 'RP', 'O'), ('a', 'DT', 'O'), ('job', 'NN', 'O'), ('that', 'WDT', 'O'), ('pays', 'VBZ', 'O'), ('$', '$', 'O'), ('1', 'CD', 'O'), ('million', 'CD', 'O'), ('a', 'DT', 'O'), ('year', 'NN', 'O'), (',', ',', 'O'), ('would', 'MD', 'O'), ('oversee', 'VB', 'O'), ('the', 'DT', 'O'), ('Treasury', 'NNP', 'B-ORGANIZATION'), ("'s", 'POS', 'O'), ('auctions', 'NNS', 'O'), ('of', 'IN', 'O'), ('government', 'NN', 'O'), ('securities', 'NNS', 'O'), ('as', 'RB', 'O'), ('well', 'RB', 'O'), ('as', 'IN', 'O'), ('banking', 'NN', 'O'), ('issues', 'NNS', 'O'), ('.', '.', 'O')],)
([('He', 'PRP', 'O'), ('would', 'MD', 'O'), ('report', 'VB', 'O'), ('directly', 'RB', 'O'), ('to', 'TO', 'O'), ('Treasury', 'NNP', 'B-ORGANIZATION'), ('Secretary-designate', 'NNP', 'O'), ('Lloyd', 'NNP', 'B-PERSON'), ('Bentsen', 'NNP', 'I-PERSON'), ('.', '.', 'O')],)
([('Mr.', 'NNP', 'B-PERSON'), ('Bentsen', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('who', 'WP', 'O'), ('headed', 'VBD', 'O'), ('the', 'DT', 'O'), ('Senate', 'NNP', 'B-ORGANIZATION'), ('Finance', 'NNP', 'I-ORGANIZATION'), ('Committee', 'NNP', 'I-ORGANIZATION'), ('for', 'IN', 'O'), ('the', 'DT', 'O'), ('past', 'JJ', 'O'), ('six', 'CD', 'O'), ('years', 'NNS', 'O'), (',', ',', 'O'), ('also', 'RB', 'O'), ('is', 'VBZ', 'O'), ('expected', 'VBN', 'O'), ('to', 'TO', 'O'), ('nominate', 'VB', 'O'), ('Samuel', 'NNP', 'B-PERSON'), ('Sessions', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('the', 'DT', 'O'), ('committee', 'NN', 'O'), ("'s", 'POS', 'O'), ('chief', 'JJ', 'O'), ('tax', 'NN', 'O'), ('counsel', 'NN', 'O'), (',', ',', 'O'), ('to', 'TO', 'O'), ('one', 'CD', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('top', 'JJ', 'O'), ('tax', 'NN', 'O'), ('jobs', 'NNS', 'O'), ('at', 'IN', 'O'), ('Treasury', 'NNP', 'B-ORGANIZATION'), ('.', '.', 'O')],)
([('As', 'RB', 'O'), ('early', 'RB', 'O'), ('as', 'IN', 'O'), ('today', 'NN', 'O'), (',', ',', 'O'), ('the', 'DT', 'O'), ('Clinton', 'NNP', 'B-PERSON'), ('camp', 'NN', 'O'), ('is', 'VBZ', 'O'), ('expected', 'VBN', 'O'), ('to', 'TO', 'O'), ('name', 'VB', 'O'), ('five', 'CD', 'O'), ('undersecretaries', 'NNS', 'O'), ('of', 'IN', 'O'), ('state', 'NN', 'O'), ('and', 'CC', 'O'), ('several', 'JJ', 'O'), ('assistant', 'NN', 'O'), ('secretaries', 'NNS', 'O'), ('.', '.', 'O')],)
([('Peter', 'NNP', 'B-PERSON'), ('Tarnoff', 'NNP', 'B-ORGANIZATION'), (',', ',', 'O'), ('a', 'DT', 'O'), ('former', 'JJ', 'O'), ('Carter', 'NNP', 'B-PERSON'), ('administration', 'NN', 'O'), ('official', 'NN', 'O'), ('and', 'CC', 'O'), ('president', 'NN', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('Council', 'NNP', 'B-ORGANIZATION'), ('on', 'IN', 'O'), ('Foreign', 'NNP', 'B-ORGANIZATION'), ('Relations', 'NNP', 'I-ORGANIZATION'), (',', ',', 'O'), ('is', 'VBZ', 'O'), ('expected', 'VBN', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('named', 'VBN', 'O'), ('undersecretary', 'JJ', 'O'), ('for', 'IN', 'O'), ('political', 'JJ', 'O'), ('affairs', 'NNS', 'O'), ('.', '.', 'O')],)
([('Former', 'JJ', 'O'), ('Sen.', 'NNP', 'O'), ('Tim', 'NNP', 'O'), ('Wirth', 'NNP', 'O'), ('is', 'VBZ', 'O'), ('expected', 'VBN', 'O'), ('to', 'TO', 'O'), ('get', 'VB', 'O'), ('a', 'DT', 'O'), ('newly', 'RB', 'O'), ('created', 'VBN', 'O'), ('undersecretary', 'JJ', 'O'), ('post', 'NN', 'O'), ('for', 'IN', 'O'), ('global', 'JJ', 'O'), ('affairs', 'NNS', 'O'), (',', ',', 'O'), ('which', 'WDT', 'O'), ('would', 'MD', 'O'), ('include', 'VB', 'O'), ('refugees', 'NNS', 'O'), (',', ',', 'O'), ('drugs', 'NNS', 'O'), ('and', 'CC', 'O'), ('environmental', 'JJ', 'O'), ('issues', 'NNS', 'O'), ('.', '.', 'O')],)
([('Earlier', 'RBR', 'O'), (',', ',', 'O'), ('the', 'DT', 'O'), ('Colorado', 'NNP', 'B-ORGANIZATION'), ('Democrat', 'NNP', 'I-ORGANIZATION'), ('had', 'VBD', 'O'), ('been', 'VBN', 'O'), ('a', 'DT', 'O'), ('leading', 'VBG', 'O'), ('contender', 'NN', 'O'), ('to', 'TO', 'O'), ('head', 'VB', 'O'), ('the', 'DT', 'O'), ('Environmental', 'NNP', 'B-ORGANIZATION'), ('Protection', 'NNP', 'I-ORGANIZATION'), ('Agency', 'NNP', 'I-ORGANIZATION'), ('.', '.', 'O')],)
([('In', 'IN', 'O'), ('addition', 'NN', 'O'), (',', ',', 'O'), ('Joan', 'NNP', 'B-PERSON'), ('Spero', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('an', 'DT', 'O'), ('executive', 'JJ', 'O'), ('vice', 'NN', 'O'), ('president', 'NN', 'O'), ('of', 'IN', 'O'), ('American', 'NNP', 'B-GPE'), ('Express', 'NNP', 'O'), ('Co.', 'NNP', 'O'), (',', ',', 'O'), ('is', 'VBZ', 'O'), ('a', 'DT', 'O'), ('leading', 'JJ', 'O'), ('candidate', 'NN', 'O'), ('for', 'IN', 'O'), ('undersecretary', 'JJ', 'O'), ('for', 'IN', 'O'), ('economic', 'JJ', 'O'), ('affairs', 'NNS', 'O'), ('.', '.', 'O')],)
([('And', 'CC', 'O'), ('Time', 'NNP', 'B-ORGANIZATION'), ('magazine', 'NN', 'O'), ('columnist', 'NN', 'O'), ('Strobe', 'NNP', 'B-PERSON'), ('Talbott', 'NNP', 'I-PERSON'), ('is', 'VBZ', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('named', 'VBN', 'O'), ('ambassador-at-large', 'JJ', 'O'), ('to', 'TO', 'O'), ('coordinate', 'VB', 'O'), ('U.S.', 'NNP', 'B-GPE'), ('policy', 'NN', 'O'), ('toward', 'IN', 'O'), ('the', 'DT', 'O'), ('former', 'JJ', 'O'), ('Soviet', 'NNP', 'B-GPE'), ('Union', 'NNP', 'I-GPE'), ('.', '.', 'O')],)
([('Several', 'JJ', 'O'), ('appointees', 'NNS', 'O'), ('of', 'IN', 'O'), ('President', 'NNP', 'O'), ('Bush', 'NNP', 'B-PERSON'), ('are', 'VBP', 'O'), ('likely', 'JJ', 'O'), ('to', 'TO', 'O'), ('stay', 'VB', 'O'), ('in', 'IN', 'O'), ('office', 'NN', 'O'), ('at', 'IN', 'O'), ('least', 'JJS', 'O'), ('temporarily', 'RB', 'O'), (',', ',', 'O'), ('until', 'IN', 'O'), ('permanent', 'JJ', 'O'), ('successors', 'NNS', 'O'), ('can', 'MD', 'O'), ('be', 'VB', 'O'), ('named', 'VBN', 'O'), ('.', '.', 'O')],)
([('One', 'CD', 'O'), ('is', 'VBZ', 'O'), ('Bernadine', 'NNP', 'B-PERSON'), ('Healy', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('director', 'NN', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('National', 'NNP', 'B-ORGANIZATION'), ('Institutes', 'NNPS', 'I-ORGANIZATION'), ('of', 'IN', 'O'), ('Health', 'NNP', 'B-GPE'), ('.', '.', 'O')],)
([('Another', 'DT', 'O'), ('likely', 'JJ', 'O'), ('holdover', 'NN', 'O'), ('is', 'VBZ', 'O'), ('David', 'NNP', 'B-PERSON'), ('Kessler', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('head', 'NN', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('Food', 'NNP', 'B-ORGANIZATION'), ('and', 'CC', 'O'), ('Drug', 'NNP', 'B-PERSON'), ('Administration', 'NNP', 'I-PERSON'), ('.', '.', 'O')],)
([('In', 'IN', 'O'), ('the', 'DT', 'O'), ('offfice', 'NN', 'O'), ('of', 'IN', 'O'), ('U.S.', 'NNP', 'B-GPE'), ('Trade', 'NNP', 'O'), ('Representative-designate', 'NNP', 'O'), ('Mickey', 'NNP', 'B-PERSON'), ('Kantor', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('selections', 'NNS', 'O'), ('for', 'IN', 'O'), ('the', 'DT', 'O'), ('three', 'CD', 'O'), ('deputy', 'NN', 'O'), ('trade', 'NN', 'O'), ('representative', 'JJ', 'O'), ('slots', 'NNS', 'O'), ('and', 'CC', 'O'), ('general', 'JJ', 'O'), ('counsel', 'NN', 'O'), ('are', 'VBP', 'O'), ('still', 'RB', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('decided', 'VBN', 'O'), ('.', '.', 'O')],)
([('But', 'CC', 'O'), ('Robert', 'NNP', 'B-PERSON'), ('Kyle', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('the', 'DT', 'O'), ('Senate', 'NNP', 'B-ORGANIZATION'), ('Finance', 'NNP', 'I-ORGANIZATION'), ('Committee', 'NNP', 'I-ORGANIZATION'), ("'s", 'POS', 'O'), ('trade', 'NN', 'O'), ('counsel', 'NN', 'O'), (',', ',', 'O'), ('is', 'VBZ', 'O'), ('considered', 'VBN', 'O'), ('a', 'DT', 'O'), ('top', 'JJ', 'O'), ('candidate', 'NN', 'O'), ('for', 'IN', 'O'), ('one', 'CD', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('slots', 'NNS', 'O'), ('or', 'CC', 'O'), ('for', 'IN', 'O'), ('a', 'DT', 'O'), ('trade', 'NN', 'O'), ('post', 'NN', 'O'), ('elsewhere', 'RB', 'O'), ('in', 'IN', 'O'), ('the', 'DT', 'O'), ('government', 'NN', 'O'), ('.', '.', 'O')],)
([('For', 'IN', 'O'), ('many', 'JJ', 'O'), ('subcabinet', 'NN', 'O'), ('jobs', 'NNS', 'O'), (',', ',', 'O'), ('the', 'DT', 'O'), ('list', 'NN', 'O'), ('of', 'IN', 'O'), ('candidates', 'NNS', 'O'), ('has', 'VBZ', 'O'), ('been', 'VBN', 'O'), ('narrowed', 'VBN', 'O'), ('considerably', 'RB', 'O'), ('.', '.', 'O')],)
([('Clinton', 'NNP', 'B-PERSON'), ('officials', 'NNS', 'O'), ('are', 'VBP', 'O'), ('said', 'VBD', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('deciding', 'VBG', 'O'), ('between', 'IN', 'O'), ('recently', 'RB', 'O'), ('retired', 'VBN', 'O'), ('Rep.', 'NNP', 'O'), ('Matthew', 'NNP', 'B-PERSON'), ('McHugh', 'NNP', 'I-PERSON'), ('(', '(', 'O'), ('D.', 'NNP', 'O'), (',', ',', 'O'), ('N.Y.', 'NNP', 'B-GPE'), (')', ')', 'O'), ('and', 'CC', 'O'), ('environmental', 'JJ', 'O'), ('activist', 'NN', 'O'), ('and', 'CC', 'O'), ('transition', 'NN', 'O'), ('official', 'NN', 'O'), ('Gus', 'NNP', 'B-PERSON'), ('Speth', 'NNP', 'I-PERSON'), ('for', 'IN', 'O'), ('the', 'DT', 'O'), ('director', 'NN', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('Agency', 'NNP', 'B-ORGANIZATION'), ('for', 'IN', 'O'), ('International', 'NNP', 'B-ORGANIZATION'), ('Development', 'NNP', 'I-ORGANIZATION'), ('.', '.', 'O')],)
([('Among', 'IN', 'O'), ('others', 'NNS', 'O'), ('expected', 'VBN', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('hired', 'VBN', 'O'), ('include', 'VBP', 'O'), ('Kitty', 'NNP', 'B-PERSON'), ('Higgins', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('an', 'DT', 'O'), ('aide', 'NN', 'O'), ('to', 'TO', 'O'), ('Michigan', 'NNP', 'B-PERSON'), ('Rep.', 'NNP', 'O'), ('Sander', 'NNP', 'B-PERSON'), ('Levin', 'NNP', 'I-PERSON'), (',', ',', 'O'), ('as', 'IN', 'O'), ('chief', 'NN', 'O'), ('of', 'IN', 'O'), ('staff', 'NN', 'O'), ('in', 'IN', 'O'), ('the', 'DT', 'O'), ('Labor', 'NNP', 'B-ORGANIZATION'), ('Department', 'NNP', 'I-ORGANIZATION'), (',', ',', 'O'), ('while', 'IN', 'O'), ('Jerry', 'NNP', 'B-PERSON'), ('Palast', 'NNP', 'I-PERSON'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('Service', 'NNP', 'B-ORGANIZATION'), ('Employees', 'NNPS', 'I-ORGANIZATION'), ('International', 'NNP', 'B-ORGANIZATION'), ('Union', 'NNP', 'I-ORGANIZATION'), ('is', 'VBZ', 'O'), ('expected', 'VBN', 'O'), ('to', 'TO', 'O'), ('be', 'VB', 'O'), ('the', 'DT', 'O'), ('department', 'NN', 'O'), ("'s", 'POS', 'O'), ('director', 'NN', 'O'), ('of', 'IN', 'O'), ('legislative', 'JJ', 'O'), ('affairs', 'NNS', 'O'), ('.', '.', 'O')],)
([('Separately', 'RB', 'O'), (',', ',', 'O'), ('the', 'DT', 'O'), ('incoming', 'VBG', 'O'), ('Clinton', 'NNP', 'B-PERSON'), ('administration', 'NN', 'O'), ('is', 'VBZ', 'O'), ('seriously', 'RB', 'O'), ('considering', 'VBG', 'O'), ('moving', 'VBG', 'O'), ('the', 'DT', 'O'), ('briefing', 'NN', 'O'), ('room', 'NN', 'O'), ('for', 'IN', 'O'), ('the', 'DT', 'O'), ('press', 'NN', 'O'), (',', ',', 'O'), ('for', 'IN', 'O'), ('decades', 'NNS', 'O'), ('situated', 'VBN', 'O'), ('in', 'IN', 'O'), ('the', 'DT', 'O'), ('West', 'NNP', 'B-LOCATION'), ('Wing', 'NNP', 'I-LOCATION'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('White', 'NNP', 'B-FACILITY'), ('House', 'NNP', 'I-FACILITY'), (',', ',', 'O'), ('out', 'IN', 'O'), ('of', 'IN', 'O'), ('the', 'DT', 'O'), ('White', 'NNP', 'B-FACILITY'), ('House', 'NNP', 'I-FACILITY'), ('and', 'CC', 'O'), ('into', 'IN', 'O'), ('the', 'DT', 'O'), ('Old', 'NNP', 'B-ORGANIZATION'), ('Executive', 'NNP', 'O'), ('Office', 'NNP', 'O'), ('Building', 'NNP', 'O'), ('next', 'JJ', 'O'), ('door', 'NN', 'O'), ('.', '.', 'O')],)
([('The', 'DT', 'O'), ('current', 'JJ', 'O'), ('briefing', 'NN', 'O'), ('room', 'NN', 'O'), ('could', 'MD', 'O'), ('be', 'VB', 'O'), ('used', 'VBN', 'O'), ('for', 'IN', 'O'), ('staff', 'NN', 'O'), ('offices', 'NNS', 'O'), ('.', '.', 'O')],)
[[result_file_ner.write(convert_format(f'{name}\t{tag}\t{ner}\n', pos_table)) 
  for name, tag, ner in line]
 for line in extract_entities(content)]

如何获取这些信息


Tags: ofthetoindtnnpersonvb