2007年7月26日木曜日

How to install BNCweb (CQP-Edition)

Here's how to install the latest version of BNCweb (CQP-Edition) on Ubuntu 7.04.

The following procedure is based on my installation of BNCweb 4.0 beta on Ubuntu 7.04. Please make necessary changes according to the version of BNCweb and to your system environment.


First, install the following packages, if not installed yet.
mysql-server-5.0
libdbi-perl
libdbd-mysl-perl
libhtml-parser-perl
libparse-recdescent-perl
flex
bison
libncurses5-dev



# mkdir /BNC_XML (* or whatever)
(unzip BNCweb-distribution_Beta.zip)
# mv ~/BNCweb-distribution_Beta/BNCweb-distribution_Beta /BNC_XML/
# cd /BNC_XML/BNCweb-distribution_Beta
# chmod -R 755 cgi-bin
# chmod -R 755 lib_files
# mkdir /BNC_XML/CQP-tempXML
# chmod 777 /BNC_XML/CQP-tempXML
# cd CQP_source
# tar xvzf cwb-2.2.b98a-src.tgz
# cd cwb-3.0
(modify "Makefile.inc")
---
line 36
PLATFORM = linux
line 62
SITE = standard
---
# make clean
# make depend
# make all
# make install
# cd ..
# tar xvzf CWB-Perl-Public-1.1.3b.tar.gz
# cd CWB-Perl-Public
# cd CWB
# perl Makefile.PL
# make
# make test
# make install
# cd ../CQP
# perl Makefile.PL
# make
# make install
# cd ../CL
# perl Makefile.PL
# make
# make install
# cd../WebCqp
# perl Makefile.PL
# make
# make install
# mkdir /BNC_XML/Texts
# cd /BNC_XML/Texts
(copy texts.tar.gz on Disk 1 of BNC-XML to /BNC_XML/Texts/)
# tar xvzf texts.tar.gz
# cd ../BNCweb-distribution_Beta/BNCweb-encoder-0.5b
# mkdir /BNC_XML/registry
# perl EncodeBNC.perl -n BNC-XML -r /BNC_XML/registry/ -f -M 800 -v /BNC_XML/Index/ /BNC_XML/Texts/
(* "-M 800" specifies the allocated memory size (in MB).
It took about 5 hours on a PC with Sempron 3200+ and 2GB memory.)
# perl MakeFreqTables.perl -n BNC-XML -r /BNC_XML/registry/ -f -M 800 -v
(* It took about 50 mins on my PC.)
# cd ../lib_files
(modify "bncConfigXML.pm")
---
line 45
$bwCorpusPath = '/BNC_XML/Texts/';
line 49
$bwTempPath = 'BNC_XML/CQP-tempXML';
line 91
$bwMysqlUser = 'root';
comment out line 92
#$bwMysqlUser = 'bncweb';
comment out line 95
#$bwMysqlPwd = 'test';
line 128
$bwSuperuser = 'your_account'; (specify the administrative account)
line 130
$bwDevelopers = 'your_account'; (specify the administrative account)
---
# cd ../BNCweb-encoder-0.5b
# perl make_MySQL_tables.pl
(When asked the username of MySQL admin and its password, just press [Enter]. When asked about the directory of the tables, just press [Enter].)
(* It took about 1.5 hours on my PC.)
Configure the apache files.
Add the following lines into the appropriate apache config file.
(e.g. just before "</VirtualHost>" in /etc/apache2/sites-available/ssl)
---
Alias /bncwebXML/ /BNC_XML/BNCweb-distribution_Beta/
Alias /bncwebXML /BNC_XML/BNCweb-distribution_Beta/
<Directory /BNC_XML/BNCweb-distribution_Beta>
Options Indexes FollowSymLinks ExecCGI
AuthType Basic
AuthName bncweb
AuthUserFile /etc/bncpass
require valid-user
SetEnv PERL5LIB /BNC_XML/BNCweb-distribution_Beta/lib_files
SetEnv CORPUS_REGISTRY /BNC_XML/registry
</Directory>
ScriptAlias /cgi-binbncXML/ /BNC_XML/BNCweb-distribution_Beta/cgi-bin/
---
Restart apache(2).
Set the password for each user.
Now access http(s)://hostname/cgi-binbncXML/BNCquery.pl?theQuery=search&urlTest=yes.
The interface of BNCweb will appear.

2007年7月25日水曜日

BNCwebの新版をインストールしました

BNCweb (CQP-Edition)のベータ版を作者から入手して、インストールし、無事動くようになりました。
一箇所躓いた箇所があったのですが、作者に連絡して、環境変数を指定することで回避できるのではないかという情報をいただき、それで回避できました。
前のバージョンよりだいぶ強力に検索ができるようになっていて、今後の研究で必須のツールになりそうです。

たぶん私が日本で一番最初にBNCweb (CPQ-Edition)をインストールしたのではないかと勝手に思っていますが、簡単なインストール手順を後で載せます。

2007年7月21日土曜日

BNCweb (CQP-Edition) 公開間近

去年の秋に作者から新バージョンを直に見せてもらって以来、ずっとまだかまだかと待ち望んでいたBNCwebの新版がまもなくダウンロード可能になる模様で、BNCwebのページが更新されています。
BNCweb
ちょうど授業もほぼ終わり、時間もとれるので、公開されたら早速インストールしたいと思います。

2007年7月11日水曜日

2007年7月9日月曜日

フリーのマークシート処理システム

ちょうど試験の時期ですが、試験は作るのはもちろん、採点もなかなか手間がかかって大変なものです。
もちろん記述式であれば全て手作業で採点しなくてはいけないのですが、選択式の問題であればマークシートで実施できれば、その方が高速・確実です。

昨年度から、TOEICのクラスの試験は60分100問のTOEICのハーフテストにしているのですが、これであれば、マークシートでの実施に適しています。より実際の試験に近づくというメリットもあります。
そこで、フリーでマークシートを作成し、スキャナを使って読み取りを行うシステムを探したところ、見つけることができました。
マークシート処理システム

ただし、このシステムで作れるマークシートはそれほど柔軟ではないので、作ったシートをpaint.netで編集しました。
具体的には、1-2-3-4という選択肢をA-B-C-Dに変え、Part 2では選択肢Dを削除し、学籍番号入力欄を加工しました。
さらに上部に大学指定の氏名欄などコピーし、解答用紙を作成し、テストしたところ正確に読み取れました。

今回はこれで採点を実施したいと思います。