Comments (5)
from 2017.
from 2017.
I'm a day late but I posted the source code and a new version of the output. For the new version, I decided to ignore punctuation tokens when calculating the vectors for each novel. The result has fewer commas and variation that is a bit more interesting IMO!
from 2017.
Some progress! I present: The Average Novel.
I'm still working with Project Gutenberg files from the April 2010 DVD ISO (downloadable here)
and Leonard Richardson's 47000_metadata.json. Steps:
(1) Fetch every text in PG that was labelled as fiction and then parsed them into sentences and used gensim's Word2Vec module to calculate 100-dimensional word embeddings from the resulting sentences.
(2) Create an array of word embeddings for every text (by looking up each word in the embedding) and normalize the length of these arrays to 50,000 (leaving ~11k arrays of dimensionality (50000,100)
).
(3) Sum the arrays for every length-normalized text and divide by the number of texts.
(4) For each vector in the resulting array, find the word with the closest embedding.
I guess I secretly hoped that this technique would reveal, average face-like, the Narrative Ur-text underlying all storytelling. But the result is pretty much what I actually expected: all of the structural variation gets lost in the wash. (The Produced
and Proofreaders
tokens at the top are obviously remnants of PG credits and boilerplate that weren't caught by the filtering tools I'm using; the ,
token just happens to have been the vector most central to the average, which I guess kinda makes sense given how Word2Vec works. Not sure what all those pachyderms are doing in there though.)
I'm planning to continue experimenting with this technique, but wanted to share this progress in case further experiments extend past the deadline.
from 2017.
going to post the source code for this soon, stay tuned!
from 2017.
Related Issues (20)
- Dial "S" for Sudoku HOT 2
- Grammar-based Generation HOT 1
- Shakespeare Summarizes Everything HOT 6
- Hard West Turn HOT 5
- Every Novel Generator HOT 5
- A Picture is Worth N Words HOT 1
- Tillman, Victor Lima, KOD HOT 5
- Emic Automata HOT 6
- views on an object -- kr pipkin & v21
- 2d Markov HOT 2
- What is Trump? by @hugovk
- The Infinite Fight Scene HOT 6
- LSTM-based Leo Tolstoy text generator
- Thematic Automata HOT 2
- Pride, Prejudice by @hugovk HOT 13
- The Edward Lear Limerick Generator HOT 4
- Frequency transforms of text HOT 4
- Icebox by @hugovk
- NaNoGenMo/Creative NLP Slack channel? HOT 7
- Language survey 2017 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 2017.