#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
| # Thanking everyone who wished me on my birthday | |
| import requests | |
| import json | |
| AFTER = 123456 | |
| TOKEN = ' <insert token here> ' | |
| def get_posts(): | |
| """Returns dictionary of id, first names of people who posted on my wall |
| rm(list = ls()) | |
| gc() | |
| dir() | |
| suppressMessages(library(lubridate)) | |
| suppressMessages(library(caret)) | |
| suppressMessages(library(gbm)) | |
| suppressPackageStartupMessages(library(data.table)) | |
| suppressPackageStartupMessages(library(h2o)) |
| import fb #To install this package run: sudo pip install fb | |
| from facepy import GraphAPI #To install this package run: sudo pip install facepy | |
| import time | |
| token=""#Insert access token here. | |
| facebook=fb.graph.api(token) | |
| graph1 = GraphAPI(token) | |