我們準備了兩個句子來進行這次實驗
sentences = ['helo attention','have a nice day']一開始先建立詞表與對應的單詞one-hot encoding
vocabs = ' '.join(sentences).split()
vocabs = list(set(vocabs))| import asyncio | |
| from datetime import datetime, timezone | |
| import os | |
| def utc_now(): | |
| # utcnow returns a naive datetime, so we have to set the timezone manually <sigh> | |
| return datetime.utcnow().replace(tzinfo=timezone.utc) | |
| class Terminator: | |
| pass |
| # (C) Kyle Kastner, June 2014 | |
| # License: BSD 3 clause | |
| import scipy.stats as st | |
| import numpy as np | |
| class gmmhmm: | |
| #This class converted with modifications from https://code.google.com/p/hmm-speech-recognition/source/browse/Word.m | |
| def __init__(self, n_states): | |
| self.n_states = n_states |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,