Code Monkey home page Code Monkey logo

npbdaa's Introduction

Nonparametric Bayesian Double Articulation Analyzer

This is a Python implementation for Nonparametric Bayesian Double Articulation Analyzer (NPB-DAA). The NPB-DAA can directly acquire language and acoustic models from observed continuous speech signals.

This generative model is called hiererichel Dirichlet process hidden language model (HDP-HLM), which is obtained by extending the hierarchical Dirichlet process hidden semi-Markov model (HDP-HSMM) proposed by Johnson et al. An inference procedure for the HDP-HLM is derived using the blocked Gibbs sampler originally proposed for the HDP-HSMM.

Requirement

  • Ubuntu 16.04 LTS
  • Python 3.6.5
  • Numpy 1.14.2
  • Scipy 1.0.1
  • Scikit-learn 0.19.1
  • Matplotlib 2.2.2
  • Joblib 0.11
  • Cython 0.28.2
  • tqdm 4.23.4
  • pybasicbayes 0.2.2
  • pyhsmm 0.1.6

Installation instructions

  1. Install GNU compiler collection to use Cython.
$ sudo apt install gcc
  1. Install the necessary libraries for installation.
$ pip install numpy future six
$ pip install cython
  1. Install pybasicbayes.
$ git clone https://github.com/mattjj/pybasicbayes
$ cd pybasicbayes
$ python setup.py install
  1. Install pyhsmm.
$ git clone https://github.com/RyoOzaki/pyhsmm
$ cd pyhsmm
$ python setup.py install

The repository of pyhsmm was forked and updated by Ryo Ozaki. If you want to install pyhsmm of master repository, please go to https://github.com/mattjj/pyhsmm But, the master repository's codes include some bugs in cython codes.

  1. Install pyhlm (this).
$ git clone https://github.com/RyoOzaki/npbdaa npbdaa
$ cd npbdaa
$ python setup.py install

Sample source

There is a sample source of NPB-DAA in "sample" directory. Please run the "unroll_default_config" before run "pyhlm_sample", and you can change the hyperparameters using the config file "hypparams/defaults.config".

$ cd sample
$ python unroll_default_config.py
$ python pyhlm_sample.py
$ python summary_and_plot.py

References

Authors

Tadahiro Taniguch, Ryo Nakashima, Nagasaka Shogo, Tada Yuki, Kaede Hayashi, and Ryo Ozaki.

License

  • MIT
    • see LICENSE

npbdaa's People

Contributors

ryoozaki avatar

Stargazers

thomas avatar  avatar kishiyamat (Takeshi Kishiyama) avatar  avatar Akira Taniguchi avatar Xavier Hinaut avatar

Watchers

James Cloos avatar Xavier Hinaut avatar  avatar

npbdaa's Issues

[README] requestsについて

setup.pyの実行でrequestsライブラリが必要ですが, READMEに載っていません.
事前に
pip install requests
でインストールを行います.

Install pyhsmm で urllib.error.HTTPError: HTTP Error 403: Forbidden

Eigen のリポジトリは bitbucket から gitlab に移行したようです。(参照: spack/spack#13890)
したがって https://github.com/RyoOzaki/pyhsmmsetup.py も deprecate しています。Eigenのダウンロードのスクリプトをフォーク元と同様、以下のように変更すればエラーは解消します。加えて、import に requests を追加する必要もあります。

# download Eigen if we don't have it in deps
eigenurl = 'https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz'
eigentarpath = os.path.join('deps', 'Eigen.tar.gz')
eigenpath = os.path.join('deps', 'Eigen')
if not os.path.exists(eigenpath):
    print('Downloading Eigen...')
    r = requests.get(eigenurl)
    with open(eigentarpath, 'wb') as f:
        f.write(r.content)
    with tarfile.open(eigentarpath, 'r') as tar:
        tar.extractall('deps')
    thedir = glob(os.path.join('deps', 'eigen-*'))[0]
    shutil.move(os.path.join(thedir, 'Eigen'), eigenpath)
    print('...done!')

ですが、もしソース元でフォークのモチベーションである "But, the master repository's codes include some bugs in cython codes." が解消されているならば、 mattjj/pyhsmm を利用させるか、"some bugs in cython codes" のプルリクエストを mattjj/pyhsmm に送った方が、今後のメンテナンスコストが下がるように思えます。

先日は Issue の解決ありがとうございました。RyoOzaki/pyhsmm の issue 機能が有効化されていない、また RyoOzaki/npbdaa のセットアップ 中のエラーであるためこちらに失礼します。

NameError: name 'Path' is not defined

There is a NameError in summary_and_plot.py (line 100). Just importing the module may resolve this issue.

$ python summary_and_plot.py
Traceback (most recent call last):
  File "summary_and_plot.py", line 100, in <module>
    Path("figures").mkdir(exist_ok=True)
NameError: name 'Path' is not defined

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.