#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
| mahout clusterdump \ | |
| -dt sequencefile \ # format: {Integer => String} | |
| -d reuters-vectors/dictionary.file-* \ # dictionary: {id => word} | |
| -i reuters-kmeans-clusters/clusters-3-final \ # input | |
| -o clusters.txt \ # output (local filesystem) | |
| -b 10 \ # format length | |
| -n 10 # number of top terms to print | |
| --distanceMeasure org.apache.mahout.common.distance.CosineDistanceMeasure # default is euclidean distance |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>dataproj.maven</groupId> | |
| <artifactId>running-lucene-with-maven</artifactId> | |
| <packaging>war</packaging> | |
| <version>0.1</version> | |
| <profiles> | |
| <!-- Add profile configuration here --> | |
| </profiles> |
| If: | |
| - you add and commit with the wrong email address in git, and | |
| - your remote has a hook set up to prevent you from pushing with the bad address | |
| Then you need to amend the author of your commit before push can succeed: | |
| 1. fix your email address in git config: | |
| $ git config user.name "Your Name" |
#A Collection of NLP notes
##N-grams
###Calculating unigram probabilities:
P( wi ) = count ( wi ) ) / count ( total number of words )
In english..
| \documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$]{$documentclass$} | |
| \usepackage[T1]{fontenc} | |
| \usepackage{lmodern} | |
| \usepackage{amssymb,amsmath} | |
| \usepackage{euler} | |
| \usepackage{ifxetex,ifluatex} | |
| \usepackage{fixltx2e} % provides \textsubscript | |
| % use microtype if available | |
| \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex | |
| \IfFileExists{microtype.sty}{\usepackage{microtype}}{} |
| httpClient.DefaultRequestHeaders.Authorization = | |
| new AuthenticationHeaderValue( | |
| "Basic", | |
| Convert.ToBase64String( | |
| System.Text.ASCIIEncoding.ASCII.GetBytes( | |
| string.Format("{0}:{1}", username, password)))); |
| <div id="app"></div> |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| // LAST EDIT: 30/11/2015 | |
| //GULP 4 | |
| var gulp = require('gulp'); | |
| var merge = require('merge2'); | |
| var source = require('vinyl-source-stream'); | |
| var browserify = require('browserify'); | |
| var uglify = require("gulp-uglify"); | |
| var buffer = require('vinyl-buffer'); | |
| var notify = require('gulp-notify'); | |
| var nodemon = require('gulp-nodemon'); |
| #!/bin/bash | |
| set -e | |
| apt-get install -y curl python-setuptools python-pip python-dev python-protobuf | |
| # zookeeper | |
| apt-get install -y zookeeperd | |
| echo 1 | dd of=/var/lib/zookeeper/myid |