All Projects → aparrish → Phonetic Similarity Vectors

aparrish / Phonetic Similarity Vectors

Licence: mit
Source code to accompany my paper "Poetic sound similarity vectors using phonetic features"

Projects that are alternatives of or similar to Phonetic Similarity Vectors

Tensorflow center loss
Center Loss implementation with TensorFlow
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Covid 19 Eda Tutorial
This tutorial's purpose is to introduce people to the [2019 Novel Coronavirus COVID-19 (2019-nCoV) Data Repository by Johns Hopkins CSSE](https://github.com/CSSEGISandData/COVID-19) and how to explore it using some foundational packages in the Scientific Python Data Science stack.
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook
Machine Learning
🌎 machine learning tutorials (mainly in Python3)
Stars: ✭ 1,924 (+1200%)
Mutual labels:  jupyter-notebook
Nyc Transport
A Unified Database of NYC transport (subway, taxi/Uber, and citibike) data.
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Cpndet
Corner Proposal Network for Anchor-free, Two-stage Object Detection
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook
Practicaldl
A Practical Guide to Deep Learning with TensorFlow 2.0 and Keras materials for Frontend Masters course
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook
Stock Price Predictor
This project seeks to utilize Deep Learning models, Long-Short Term Memory (LSTM) Neural Network algorithm, to predict stock prices.
Stars: ✭ 146 (-1.35%)
Mutual labels:  jupyter-notebook
Pytorch Tutorials Kr
🇰🇷PyTorch에서 제공하는 튜토리얼의 한국어 번역을 위한 저장소입니다. (Translate PyTorch tutorials in Korean🇰🇷)
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Covid19 inference forecast
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Project kojak
Training a Neural Network to Detect Gestures and Control Smart Home Devices with OpenCV in Python
Stars: ✭ 147 (-0.68%)
Mutual labels:  jupyter-notebook
Bayesian Analysis With Python
Bayesian Analysis with Python by Packt
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Refer
Referring Expression Datasets API
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Machinehack
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook
Qa With Tensorflow
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Forecasting
Time Series Forecasting Best Practices & Examples
Stars: ✭ 2,123 (+1334.46%)
Mutual labels:  jupyter-notebook
Tensorflow
Tensorflow相关教程
Stars: ✭ 148 (+0%)
Mutual labels:  jupyter-notebook
Covid19
Analyses about the COVID-19 virus
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook
Deeplab v2
基于v2版本的deeplab,使用VGG16模型,在VOC2012,Pascal-context,NYU-v2等多个数据集上进行训练
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook
Machine Learning
python,机器学习笔记,machine learning,nlp
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook
Predicting Stock Prices With Linear Regression
Stars: ✭ 149 (+0.68%)
Mutual labels:  jupyter-notebook

Poetic sound similarity vectors using phonetic features

This is the source code used to implement the algorithms, experiments and applications in my paper, "Poetic sound similarity vectors using phonetic features." The source code is written in Python.

You can read the paper here. EXAG posted a summary of the paper as well, and you can watch this talk that I gave at Strange Loop 2017 that discusses much of the paper's content in an accessible way.

Dependencies

Almost everything should be covered in a standard Anaconda install, i.e.:

  • pandas
  • matplotlib
  • numpy
  • scikit-learn

You'll also need spaCy and Annoy for some of the applications, which you can install with pip or through conda-forge. For spaCy:

conda config --add channels conda-forge
conda install spacy
python -m spacy download en_core_web_md

For Annoy:

conda config --add channels conda-forge
conda install python-annoy

(Note: You don't need any of this stuff if you just want to play around with the pre-computed vectors! Though I definitely recommend using a fast nearest-neighbor search library like Annoy.)

Files

CMU Dict and pre-computed vectors

The file cmudict-0.7b-with-vitz-nonce contains the most current (as of this writing) version of the CMU Pronouncing Dictionary, edited to include the "nonce" words from Vitz and Winkler (1973).

The file cmudict-0.7b-simvecs contains pre-computed vectors for all of the words in cmudict-0.7b-with-vitz-nonce. This is probably the file you want if you just want to play around with the vectors! The vectors are formatted just like the CMU Pronouncing Dictionary (i.e., word in all caps, two spaces, then space-separated values per dimension).

Python source

Run generate.py to create your own set of vectors from a CMU Pronouncing Dictionary source file. Pass the dictionary as input and redirect the output to your desired file, e.g.:

PYTHONIOENCODING=latin1 python generate.py <cmudict-0.7b-with-vitz-nonce >cmudict-0.7b-simvecs

Note that you must specify latin1 encoding when running this script (unless your dictionary uses some other character set).

The similarity.py script is a quick script for checking your vectors. Pass the file with your similarity vectors as a command line argument, and the program will respond to every line of standard input with the most similar items from the embedding:

$ python similarity.py cmudict-0.7b-simvecs
loading...
done.
ELEPHANT
['ELEPHANT', "ELEPHANT'S", 'ELEPHANTS', "ELEPHANTS'", 'ENTOFFEN', 'UFFELMAN', 'UNRUFFLED', 'MUFFLE', "ENTOFFEN'S", 'KALAFUT']
AARDVARK
['AARDVARK', 'AARDVARKS', 'AARGH', 'ARGH', 'ARC', 'ARK', 'ARB', 'ARTCARVED', 'ALSGAARD', 'ARCHARD']
BADGER
['BADGER', 'BADER', 'BATHER(1)', 'BADGERED', 'BISER', "BADGER'S", 'BADGERS', 'BADDERS', 'MADAR', 'MADDER']
DOLPHIN
['DOLPHIN', 'DOLPHINS', "DOLPHINS'", 'DALFEN', 'GALVEN', 'DONELSON', 'GALVAN', 'JARVIS', 'GALVESTON', 'DARTH']

Hit ^D when you're done.

Finally, featurephone.py contains a few helper functions that help build the bigram analysis of the dictionary.

Jupyter notebooks

  • experiment.ipynb contains the code to run the experiments comparing the phonetic similarity reported by the embeddings in my paper to the similarity scores obtained from human subjects in Vitz and Winkler (1973).
  • some-applications.ipynb contains a number of playful and poetic experimental applications of the phonetic similarity embeddings (including sound analogies, averages, symbolism tinting, etc.)

Still forthcoming: An example of how to use the embeddings for longer stretches of text, as in the "random walk" example in the paper.

License

See LICENSE, which applies to everything in this repository except the copy of the CMU Pronouncing Dictionary, which is used under the terms of their license (included in the header of the file), and the data from Vitz and Winkler, for which I claim fair use.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].