{{ message }}

Instantly share code, notes, and snippets.

😁

# Beatriz Albiero beatrizalbiero

😁
Last active Aug 20, 2019
latex equations for bigrams language model
View bigrams_latex.tex
 \begin{equation} \label{eq:bigramsp} P(t|t_{1}^{n-1}) \approx P(t|t_{n-1}) \end{equation} \begin{equation} \label{eq:brigrams} P(t_n|w_{t-1}) = \frac{C(t_{n-1}t_n)}{C(t_{n-1})} \end{equation}
Last active Aug 19, 2019
The Chain Rule of Probability in Latex
View chain_rule_of_probability.tex
 \begin{equation} P(X_1, X_2, \cdots, X_n) = P(X_1)\cdot P(X_2|X_1)\cdot P(X_3|X_1, X_2) \cdots P(X_n|X_{n-1}, X_{n-2}, \cdots, X_1) =\notag\\ \end{equation} \begin{equation} \prod_{k=1}^{n} P(X_{k}|X_{1}^{k-1}) \end{equation}
Created Dec 27, 2017
copy first column to last colum of a csv file
View treatcsv.py
 def readCSV(filename): f = open(filename,"r") y = open('saida.csv',"w") for row in f: treat = row.strip("\n").strip("\r")+';\n' new_list = treat.split(';') #str to list new_list[-1] = new_list[0] new_string = '' for i in range(0,len(new_list)-1): new_string = new_string + new_list[i] + ';'