{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from weasyprint import HTML, CSS\n", "from weasyprint.fonts import FontConfiguration\n", "import nltk\n", "\n", "font_config = FontConfiguration()\n", "\n", "txt = open('txt/practicalvision.txt').read()\n", "words = nltk.word_tokenize(txt) #tokenizing the text\n", "tagged_words = nltk.pos_tag(words) #generating grammar tags for the tokens\n", "\n", "content = ''\n", "content += '