This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import xlsxwriter | |
| # Create workbook with a new worksheet. | |
| workbook = xlsxwriter.Workbook('hello.xlsx') | |
| worksheet = workbook.add_worksheet() | |
| # Write the tokens. | |
| worksheet.write('A1', 'Hello') | |
| worksheet.write('B1', 'world') | |
| worksheet.write('C1', '!') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import spacy | |
| nlp = spacy.load('nl_core_news_sm') | |
| with open('bordewijk.txt') as f: | |
| doc = nlp(f.read()) | |
| people = [ent.orth_ for ent in doc.ents if ent.label_ == 'PERSON'] | |
| print(people) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| import re | |
| import time | |
| r = requests.get('https://direct.mit.edu/books/book/5244/The-Open-Handbook-of-Linguistic-Data-Management', | |
| stream=True, headers={'User-agent': 'Mozilla/5.0'}) | |
| urls = re.findall('href="(.*?.pdf)"', r.text) | |
| base = 'https://direct.mit.edu' | |
| urls = [base + path for path in urls if '/book/' in path] |
OlderNewer