Contents:
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
""" | |
Bi-Term Topic Model (BTM) for very short texts. | |
Literature Reference: | |
Xiaohui Yan, Jiafeng Guo, Yanyan Lan, and Xueqi Cheng: | |
"A biterm topic model for short texts" | |
In Proceedings of WWW '13, Rio de Janeiro, Brazil, pp. 1445-1456. | |
ACM, DOI: https://doi.org/10.1145/2488388.2488514 | |
This module requires pre-processing of textual data, |
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
install.packages( | |
c( | |
"dplyr", # data manipulation | |
"tidyr", # data manipulation | |
"rmarkdown", # data presentation | |
"knitr", # data presentation | |
"RODBC", # database tools | |
"RMySQL", # database tools | |
"RPostgreSQL", # database tools | |
"RSQLite", # database tools |
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
qpdf --password=passwd --decrypt orig.pdf decrypted.pdf | |
#To input the password | |
read -s -p "Password: " password && qpdf --password=$password --decrypt orig.pdf decrypted.pdf |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def create_figure(size=3.6,nxticks=6): | |
import matplotlib | |
from matplotlib.ticker import MaxNLocator | |
figure=matplotlib.pyplot.figure(figsize=(size,size)) | |
ax = figure.add_subplot(1, 1, 1, position = [0.2, 0.15, 0.75, 0.75]) | |
ax.xaxis.set_major_locator(MaxNLocator(nxticks)) | |
return ax | |
def format_axes(ax,xf='%d',yf='%d',nxticks=6,nyticks=6,labelsize=10): | |
import pylab |
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
class Graph: | |
def __init__(self): | |
self.nodes = set() | |
self.edges = defaultdict(list) | |
self.distances = {} | |
def add_node(self, value): | |
self.nodes.add(value) | |
def add_edge(self, from_node, to_node, distance): |
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
def memoize(fn): | |
cache = {} | |
def wrapper(*args): | |
try: | |
return cache[args] | |
except: | |
result = fn(*args) | |
cache[args] = result | |
return result | |
return wrapper |
NewerOlder