teeveed

所属分类:人工智能/神经网络/深度学习
开发工具:Ruby
文件大小:1155KB
下载次数:0
上传日期:2019-01-18 05:41:19
上 传 者sh-1993
说明:  与媒体中心的天然语言界面。使用wit.ai和jruby
(teeveed,Natural language interface to the media center. Uses wit.ai and jruby)

文件列表:
.idea (0, 2019-01-18)
.idea\codeStyleSettings.xml (324, 2019-01-18)
.idea\inspectionProfiles (0, 2019-01-18)
.idea\inspectionProfiles\Project_Default.xml (505, 2019-01-18)
.idea\inspectionProfiles\profiles_settings.xml (235, 2019-01-18)
.idea\libraries (0, 2019-01-18)
.idea\libraries\guava_16_0_1.xml (215, 2019-01-18)
.ruby-version (20, 2019-01-18)
arena (0, 2019-01-18)
arena\library (0, 2019-01-18)
arena\library\Movies (0, 2019-01-18)
arena\library\Movies\Star Wars - The New Hope.avi (11, 2019-01-18)
arena\library\Movies\The Incredibles (2008).mkv (15, 2019-01-18)
arena\library\Movies\Zoolander (2001).avi (23, 2019-01-18)
arena\library\Television (0, 2019-01-18)
arena\library\Television\Breaking Bad (0, 2019-01-18)
arena\library\Television\Breaking Bad\breaking.bad.scenerip.x456.tar.mp4 (4, 2019-01-18)
arena\library\Television\Game of Thrones (0, 2019-01-18)
arena\library\Television\Game of Thrones\Season 02 (0, 2019-01-18)
arena\library\Television\Game of Thrones\Season 02\Game of Thrones - S02E03 - What is Dead May Never Die.mp4 (39, 2019-01-18)
arena\library\Television\Game of Thrones\Specials (0, 2019-01-18)
arena\library\Television\Game of Thrones\Specials\Game of Thrones - Special - How I met your mother.m4v (25, 2019-01-18)
assembly.xml (1422, 2019-01-18)
bin (0, 2019-01-18)
bin\teeveed (336, 2019-01-18)
config (0, 2019-01-18)
config\example.teeveed.conf.rb (1855, 2019-01-18)
config\test.teeveed.rb (701, 2019-01-18)
drip.env.sh (515, 2019-01-18)
dripmain.rb (211, 2019-01-18)
env.sh (574, 2019-01-18)
lib (0, 2019-01-18)
lib\rhino_patch.rb (365, 2019-01-18)
lib\teevee.rb (462, 2019-01-18)
lib\teevee (0, 2019-01-18)
lib\teevee\application.rb (566, 2019-01-18)
lib\teevee\daemon.rb (5828, 2019-01-18)
lib\teevee\daemon (0, 2019-01-18)
... ...

# ![teeveed icon](http://justjake.github.io/teeveed/images/teeveed-256.png) natural language daemon for the media center. This was my winter break project winter from 12/28/13 - 1/10/14, and now development has ceased. See [the writeup on jake.tl](https://jake.tl/projects/teeveed/). The original README and notes are preserved below. --- ## What it does **teeveed** is a media center daemon you control with your voice. Right now, you talk to it with your smartphone's web browser. You tell teeveed to play a movie or an episode of a show you want to see that you have on your share, and it opens VLC for you. Behind the scenes, teeveed runs an indexer to keep finding files fast. It runs a webserver so you can communicate with it, and it has a nice pleasent heads-up display, so you can see what it's doing. ![screenshot of the HUD](http://justjake.github.io/teeveed/images/hud.png) ## Development #### Current Tasks 1. Switching from `DataMapper` to `Sequel` for our ruby-hipster ORM. DataMapper does too much work that keeps us from raw SQL, which we need to implement trigram-based text matching 2. Use the JavaFX entry point. Right now teeveed boots from `jar-bootstrap.rb` via JRuby's `org.jruby.JarBootstrapMain`. We need to use a JavaFX main to use JavaFX bundling tools and eliminate dependence on `mvn com.zenjava:javafx-maven-plugin:2.0:fix-classpath` for deployment 3. Switch from JRuby-based JIT compiling to AOT compiling. teeveed boots really, really slowley, and that's because there's a lot of JIT happening when the jar is loaded. Maybe things would go faster if we pre-compiled teeveed (and its gems). #### Requirements - Java JDK 1.7 - Maven 2+ - JRuby 1.7.x - PostgreSQL 9.1+ *with* the `pg_trgm` extension! **pg_trgm** is one of the ways we find similar-text matches teeveed uses [gem-maven-plugin][gem] instead of `Bundler` to manage requirements. See `pom.xml` for more information. #### Get Hacking 1. `git clone https://github.com/justjake/teeveed` or similar to get the source 2. `cd teeveed`, `mvn initialize` will download and install the required rubygems in `teeveed/target/rubygems` 3. `source env.sh` will correct your `$GEM_HOME` and `$RUBY_LIB` environment variables to point to the gems installed in `teeveed/target/rubygems` and the teeveed sources. 4. Hack away. run `teeveed` (alias provided by env.sh) to start the daemon, or `cli` to start the Pry command line. If things feel too slow, You should get [drip](https://github.com/flatland/drip) in your ~/bin, and then `source drip.env.sh` before launching any of this ruby junk. Drip'll put the spring back in your step! ## Installation #### Requirements - Java JDK 1.7 - Maven 2+ (for HUD) - a Postgres database The only reason we need Maven and the JDK is because (right now) teeveed isn't packaged as a JavaFX runtime app. Because the JavaFX runtime does some interesting [native loading things][javafx-oops], the simplest way is just to move the JavaFX libraries into the implicit system classpath. I will get around to fixing this, but it's low priority for my own machines. #### Instructions 1. `(sudo) mvn com.zenjava:javafx-maven-plugin:2.0:fix-classpath` This moves JavaFX onto the classpath so the JavaFX libraries are always loaded. **THIS STEP IS ONLY REQUIRED ON USER-INTERFACE MACHINES** 1. make a directory for all of the teeveed resources. I like `~/teeveed`. 1. copy `teeveed-0.2.2.jar` and `example.teeveed.conf.rb` into your teeveed folder. 1. copy `teeveed.sh` into your `~/bin` or somewhere else on your path, and modify `$TEEVEED_HOME` in it to point to your teeveed folder. 1. Create a Postgres database and user for teeveed. Make sure your postgres instance is accessable over TCP (unencrypted) 1. Change `example.teeveed.conf.rb` so that it matches your setup. Important things to change: - `database` command to match the setup of your Postgres database - `library` command's path should be '/path/to/your/media' - You'll need to insert your Wit.ai token for the `teeveed` instance [javafx-oops]: http://zenjava.com/javafx/maven/fix-classpath.html [gem]: https://github.com/torquebox/jruby-maven-plugins#installing-gems-into-you-project-directory ## Goals #### Index - Keep a fast index of all the media on a share for quick search (DONE) - index needs to respond to natural-language searches (DONE) - few spelling mistakes, mostly word transpositions (TODO: switch to trigram) - deleted items should be pruned regularly (DONE) - delegte music indexing and search to Spotify (TODO) ##### Strategy The index is stored in a PostgeSQL database, which gets us nice full-text-search for free. Indexing is performed by crawling each library section on a specified schedule, and adding new items, and removing old items based on a `last_seen` timestamp. At some point we should use the following algorithm when returning search results, so that we never return a file that doesn't exist: ```ruby # Array returned in ranked order from best to worst match results = root.search(:title => "the good the bad the ugly", :sense => :watch) results.each do |hit| path = Pathname.new(root.path) + hit.relative_path if not path.exist? hit.delete! next end path = path.realpath.to_s return Result.new(hit, path) end ``` #### Natural Language Interface - User story: you sit down on the couch and say, "Ok tv. do we have the new Game of Thrones?" - User story: you want to quickly start music playing while in the kitchen. "Ok tv. Play songs by Royksopp" We use [**Wit.ai**](http://wit.ai) to interpret user intents from plain text. Intent behavior is defined in `lib/teevee/daemon/intent_controller.rb`, which performs dispatch based on intent type. #### Visual indicators (DONE) teeveed uses a simple JavaFX window to display user intents and matched entities on-screen. All intents are automatically displayed before they are handled, and the results of the handler (anything with a :friendly_name) function are displayed when the handler completes.

近期下载者

相关文件


收藏者