大野さんがPacling2017で発表しました(2017/8/17)

M1の大野さんが Yangonで開催されたPacling2017で発表しました.http://pacling.ucsy.edu.mm/pacling/pSchedule2.html

書誌情報はこちら
Masayuki Ohno, Koichi Takeuchi, Kota Motojin, Masahiro Taguchi, Yoshihiko Inada, Masaya Iizuka, Tatsuhiko Abo and Hitoshi Ueda. Construction of Open Essay Writing Data and Automatic Essay Scoring System for Japanese, in Proceedings of The 15th International Conference of the Pacific Association for Computational Linguistics (PACLING2017), Yangon, Myanmar, pp.215-220, 17th (16-18), August, 2017.

webサイトを更新 (2017/3/28)

Webサイトを更新しました.CMSそのものを入れ替えてコンテンツなどを整理しました.更新によってなにか今まで公開していた古いデータなどがもし必用な場合はご連絡下さい.

石橋さんが言語理解とコミュニケーション研究会で発表しました(2017/2/9)

M2の石橋さんが言語理解とコミュニケーション研究会で発表しました.http://www.ieice.org/ken/program/index.php?tgs_regid=e4af9c50b5491fc4a786598553a285e78f74c3172e1601d4a12732d4b7b69f52&tgid=IEICE-NLC&lang=

石橋和也,影浦 峡,岩井美樹,竹内孔一,専門用語辞書拡張システムの構築,電子情報通信学会言語理解とコミュニケーション研究会,pp.13-17,2017, 2月9日 (2/9-10), 大阪.

齋藤さんが言語理解とコミュニケーション研究会で発表しました(2017/2/9)

M2の齋藤さんが言語理解とコミュニケーション研究会で発表しました.
http://www.ieice.org/ken/program/index.php?tgs_regid=e4af9c50b5491fc4a786598553a285e78f74c3172e1601d4a12732d4b7b69f52&tgid=IEICE-NLC&lang=

書誌情報
齋藤彰,竹内孔一,コピュラ文を考慮した述語項構造解析器による含意認識,電子情報通信学会言語理解とコミュニケーション研究会,pp.1-5,2017, 2月9日(2/9-10), 大阪.

How to see the values of TensorArray (2016/11/20)

I roughly understand the relations between TensorArray and Tensor in Tensorflow 0.80, then I would write my memos and codes. TensorArray is a special types of tensor that can modify its value in while_loop, and we cannot apply Session.run to an instance of TensorArray. This means that we cannot see the values in TensorArray. Thus we need to convert TensorArray to Tensor that Session.run can be applied to. The conversion is enable by TensorArray.pack(). A simple example of using TensorArray code is here.

import tensorflow as tf
import numpy as np
from tensorflow.python.ops import tensor_array_ops
#Simple example of seeing values in TensorArray
# just adding [2.4, 3.5] to TensorArray three times

def body(time,output_ta_l):
output_ta_l = output_ta_l.write(time, [2.4,3.5])
return time+1, output_ta_l

def condition(time,output_ta_l):
return tf.less(time, 3)

time = tf.constant(0)
output_ta = tensor_array_ops.TensorArray(tf.float32, size=1, dynamic_size=True)

result = tf.while_loop(condition, body, [time,output_ta])
ltime, lout = result
final_out = lout.pack()
with tf.Session():
tf.initialize_all_variables().run()
print(ltime.eval())
print("final_out==",final_out.eval())

You can get the result below.

3
final_out== [[ 2.4000001 3.5 ]
[ 2.4000001 3.5 ]
[ 2.4000001 3.5 ]]

So if you convert TensorArray to Tensor with Tensor.Array.pack(), you can see the values with print.

Reference:

http://stackoverflow.com/questions/40339510/tensorarray-initialization/40349551

http://stackoverflow.com/questions/37441140/how-to-use-tf-while-loop-in-tensorflow

redmine1.1.2から redmine3.2に問題なく移行(2016/11/04)

CentOS7.2 に新規にredmine3.2を入れて,旧redmine1.1.2で作成してきたデータを移行できました.redmineってよくできてます.下記が方法です.

データの保存

  • データの保存(mysql)
    mysqldump -u root -p --default-character-set=utf8 db_redmine > /tmp/redmine_backup_`date +%Y%m%d-%H%M%S`.sql
  • データの保存(wikiなどでの添付ファイル)
    /var/lib/redmine/files をtarで固めて移動 (/var/lib/redmineの部分は設定による)
    cd /var/lib/redmine
    tar cvfz filesback.tgz files

インストール (CentOS7.2)

  • getenforce で確認して SELinux切る
  • firewall 空ける
    firewall-cmd --zone=public --add-service=http --permanent
    firewall-cmd --reload
  • パッケージインストール
    yum groupinstall "Development Tools"
    yum install openssl-devel readline-devel zlib-devel curl-devel libyaml-devel libffi-devel httpd-devel 
    yum install ImageMagick ImageMagick-devel ipa-pgothic-fonts 
  • mysqlを入れる (mariaDBの削除)
    yum remove mariadb-libs
    yum install http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
    yum install mysql-community-server
    yum install mysql-devel
    • /etc/my.cnf を開いて最後に下記を追加(文字はUTF-8を利用)
      character_set_server=utf8
      skip-character-set-client-handshake
    • 起動
      touch  /var/lib/mysql/mysql.sock
      chown -R mysql:mysql /var/lib/mysql
      systemctl start mysqld.service
    • mysqlのパスワードなど設定
      mysql_secure_installation (これを実行)
      この時,最初のmysqlのrootパスワードの質問は無視
      Enter current password for root (enter for none): (空でenter)
      あとはいろいろ
      systemctl restart mysqld.service
  • DBにredmine(ver1.1.2)をコピーする
    • まずDBに空の redmineデータベースを作成し,redmineユーザを作る
      mysql -u root -p で入る
      CREATE DATABASE redmine CHARACTER SET utf8;
      CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'パスワード';
      GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
      quit;
    • 先ほど保存した過去のredmineDBを入れる
      mysql -u root -p --default-character-set=utf8 redmine < redmine_backup_20161104-080707.sql 
  • Rubyを CentOS7.2にいれる
    • デフォルトでは 2.0.0 が入ってるが(/usr/bin/ruby)それは削除.2.2.3にする.
    • 特に消してもバージョンアップしても今のところ問題なかった
      curl -O https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.3.tar.gz
      tar xvfz ruby-2.2.3.tar.gz
      cd ruby-2.2.3
      ./configure --disable-install-doc
      make
      make install で
      /usr/local/bin/ruby に入る
      (確認)
      ruby -v
  • gemのインストール
    gem install bundler --no-rdoc --no-ri
  • Redmineを入れる 参考は http://blog.redmine.jp/articles/3_2/install/centos/ http://weblabo.oscasierra.net/install-redmine32-centos7-1/など.redmine 3.2を入れる
    curl -O http://www.redmine.org/releases/redmine-3.2.0.tar.gz
    tar xvfz redmine-3.2.0.tar.gz
    mv redmine-3.2.0 /var/lib/  (ここはお好み)
    それで名前をredmineに変える
    cd /var/lib/
    mv redmine-3.2.0  redmine
    (この後,redmineディレクトリの下を全部 ユーザapache,グループapacheに変更するが,まだいろいろインストールするので最後にする)
  • Redmineまわりの設定とファイルの移動

    • データベース接続設定
      cd /var/lib/redmine/config/
      cp database.yml.example database.yml
      • database.ymlで 最初のproductionだけ書き直した
        production:
        adapter: mysql2
        database: redmine
        host: localhost
        username: redmine
        password: "パスワード"
        encoding: utf8
    • configuration.ymlの作成(メールの設定)
      • /var/lib/redmine/config/configuration.yml を新規に作る.configuration.yml.exampleというのもあるみたいだけど無視した
      • 内容は下記(メールの設定に合わせる)
        production:
         email_delivery:
           delivery_method: :smtp
           smtp_settings:
             address: "localhost" 
             port: 25
             domain: "fullのドメイン名" 
        
         rmagick_font_path: /usr/share/fonts/ipa-pgothic/ipagp.ttf
        
    • 必要なファイルのdownload
      cd /var/lib/redmine
      bundle install --without development test --path vendor/bundle
      ここでエラーがでた場合はメッセージを読む
      (database.ymlの中が正しいか,mysql関係のライブラリが不足しているか?など)
    • 秘密鍵の作成
      cd /var/lib/redmine
      bundle exec rake generate_secret_token
      下記のワーニングが出る
      /var/lib/redmine/vendor/bundle/ruby/2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
    • httpd との連携にむけて (passengerなどいれる)
      cd /var/lib/redmine
      gem install passenger --no-rdoc --no-ri
      passenger-install-apache2-module --auto
    • httpdに登録すべき内容の表示
      passenger-install-apache2-module --snippet

      と打つと

      LoadModule passenger_module /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
      
       <IfModule mod_passenger.c>
       PassengerRoot /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30
       PassengerDefaultRuby /usr/local/bin/ruby
       </IfModule>
      
    • 上記の内容をhttpdに設定
      touch /etc/httpd/conf.d/redmine.conf
      • としてファイルを作って内容は下記
         
         <Directory "/var/lib/redmine/public">
         Require all granted
         </Directory>
         
         LoadModule passenger_module /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30/buildout/apache2/mod_passenger.so
         
         <IfModule mod_passenger.c>
          PassengerRoot /usr/local/lib/ruby/gems/2.2.0/gems/passenger-5.0.30
          PassengerDefaultRuby /usr/local/bin/ruby
         </IfModule>
         
         RackBaseURI /redmine
         (この最後の1行も重要)

  • 旧redmineのfileをコピーする
    cd /var/lib/redmine
    mv files filesBak
    mv filesback.tgz  .
    tar xvfz filesback.tgz
    これで files ディレクトリが /var/lib/redmineの下にできる
  • データベースを修正する(これが重要)
    cd /var/lib/redmine
    RAILS_ENV=production bundle exec rake db:migrate
  • Redmineの下を apacheユーザ,apacheグループの権限に変える
    chown -R apache:apache /var/lib/redmine
  • /var/www/html/ がhttpdが公開するディレクトリの時,この下にシンボリックリンクを張る
    ln -s /var/lib/redmine/public /var/www/html/redmine 

起動

 systemctl restart httpd.service

起動時に自動で立ち上げるには

 systemctl enable httpd.service

アクセス

http://localhost/redmine/ のところにアクセスすると表示される.