Commit Graph

3062 Commits

Author SHA1 Message Date
Tetsuo Kiso
a65165f227 Move Encoder class from Scorer.h to Ngram.h.
To add unit tests.
2012-03-19 23:21:02 +09:00
Tetsuo Kiso
0edf7d3774 Add some functions to BleuScorer for unit testing.
This commit also includes
- Fix typo.
- Fix indentations.
- Add 'const' to Scorer::applyFactors().
2012-03-19 22:45:15 +09:00
Tetsuo Kiso
724b5cbb37 Create files for OptimizerFactory class; add the unit test. 2012-03-18 13:08:38 +09:00
Tetsuo Kiso
82c683758f Pass parameters by const reference. 2012-03-18 12:32:11 +09:00
Tetsuo Kiso
e08392962a Fix a file permission. 2012-03-18 10:52:40 +09:00
Matous Machacek
b89d02b4a9 Fixed bug in CderScorer.cpp 2012-03-17 23:35:56 +01:00
Tetsuo Kiso
812140274b Create Reference class to clean up BleuScorer.
- Add an unit test for Reference.
- Move functions to calculate the reference length from
  BleuScorer to Reference.
2012-03-18 05:58:40 +09:00
Hieu Hoang
0faca41e11 xcode 2012-03-15 20:31:27 +07:00
Hieu Hoang
186b7adb26 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2012-03-15 13:40:18 +07:00
Hieu Hoang
91b2804fbf xcode 2012-03-15 13:26:54 +07:00
Tetsuo Kiso
8a9385ad09 Clean up BleuScorer. 2012-03-14 22:44:51 +09:00
Tetsuo Kiso
519abd7675 Clean up BleuScorer with lookup(). 2012-03-14 22:41:29 +09:00
Tetsuo Kiso
52d8053b0e Create a header file for NgramCounts class.
The reason is that we want to add the unit test.
2012-03-14 22:14:11 +09:00
Kenneth Heafield
4bcd2c75ca KenLM c1dba12
- Reject NaNs
- Fix ChartState hashing (unused in Moses)
- Expose CreateOrThrow
- Minor portability improvement in getopt
2012-03-11 13:47:38 -04:00
Hieu Hoang
d5efa27be9 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2012-03-11 15:54:09 +07:00
Hieu Hoang
ef390a705f 1. use new gsort, rather than sort, if it is available
2. check return value of cat command in extract-parallel in case it runs out of disk space etc
2012-03-11 15:50:46 +07:00
Tetsuo Kiso
0c88a1ec2e Clean up accessors and mutators. 2012-03-10 19:27:52 +09:00
Tetsuo Kiso
3f8d8d7842 Remove hard-coded "/dev/stdout".
This will improve the portability.
We also change the interface of I/O functions for ease of the
development unit tests.
2012-03-10 19:04:43 +09:00
Tetsuo Kiso
81309bdb2d Clean up Data; add TODOs. 2012-03-10 17:47:01 +09:00
Tetsuo Kiso
a1ab79c7fc Pass by pointers to Scorer instead of references. 2012-03-10 17:28:38 +09:00
Tetsuo Kiso
eb2c9ee5e3 mert: Prefix private members with "m_" except TER.
Squashed commit of the following:

- Clean up PRO.
- Clean up ScoreStats.
- Clean up ScoreData.
- Clean up ScoreArray.
- Remove unnecessary headers.
- Clean up ScopedVector.
- Clean up Point.
- Clean up PerScorer.
- Clean up Optimizer.
- Clean up MergeScorer.
- Clean up InterpolatedScorer.
- Clean up FileStream.
- Clean up FeatureStats.
- Remove inefficient string concatenation.
- Clean up FeatureData.
- Clean up FeatureArray.
- Clean up Data.
2012-03-10 17:12:34 +09:00
Tetsuo Kiso
e4063b0f3b Minor change for calculating BLEU.
To avoid defining the similar variables twice to calculate
document-wise BLEU and sentence-wise BLEU scores.
2012-03-10 02:49:31 +09:00
Tetsuo Kiso
851a1835b6 Remove an unused variable and unnecessary 'std::'. 2012-03-07 07:19:24 +09:00
Tetsuo Kiso
6ada41576c Remove an unused variable. 2012-03-07 07:07:29 +09:00
Tetsuo Kiso
2bdeee9caa Clean up Data::loadnbest().
Add helper functions.
2012-03-07 07:01:28 +09:00
Tetsuo Kiso
19ff397aac Rewrite FeatureData::setFeatureMap(); add the unit test. 2012-03-07 06:32:38 +09:00
Kenneth Heafield
022cf38f7d Attempt to fix randlm compilation 2012-03-05 12:18:27 -05:00
Tetsuo Kiso
9e6d3c24b7 Merge branch 'prepare-for-resource-leaks' 2012-03-05 00:47:31 +09:00
Tetsuo Kiso
79b71ed5cd Use boost::scoped_ptr to avoid resource leaks. 2012-03-05 00:35:07 +09:00
Tetsuo Kiso
2351045f18 Change the private member function in mert/Timer. 2012-03-03 23:49:17 +09:00
Tetsuo Kiso
ea3bfb5d4c Delete assertions to check elapsed CPU time.
The accuracy of getrusage() is limited by the resolution
of software clock as described in
http://www.kernel.org/doc/man-pages/online/pages/man7/time.7.html

The assertions required a timer with microsecond accuracy.
However, we don't necessarily want the timer, and we don't
want to add some time-consuming processes to the test code because
we normally build programs again and again, which means
we want to run unit tests as quickly as possible.
2012-03-03 23:24:08 +09:00
Tetsuo Kiso
88b1c7e738 Disable undesirable copying Timer objects. 2012-03-03 21:12:40 +09:00
Matous Machacek
01f8fee238 Fix mert.cpp to work with InterpolatedScorer 2012-03-02 14:16:05 +01:00
Matous Machacek
d5c78d19da Added extractorargs parameter 2012-02-29 15:53:44 +01:00
Tetsuo Kiso
4d8a1e0fe6 Disable failed assertions of TimerTest anyway.
This commit is kludgy. A better solution to the problem will be pushed.
Note that the assertions have no impact on the MERT process.
2012-02-29 12:38:02 +09:00
Kenneth Heafield
1be424bcb3 KenLM 98814b2 including faster malloc-backed building and portability improvements 2012-02-28 13:58:00 -05:00
Rico Sennrich
bf54a5f38b use specified tmpdir when sorting 2012-02-28 10:05:30 +01:00
Tetsuo Kiso
37a9888a46 Fix failure of the Timer unit test. 2012-02-28 12:34:40 +09:00
Matous Machacek
457d004368 Support for using factors in mert and evaluator
example:
Use --factor "0|2" to use only first and third factor from nbest list and from reference.
If you use interpolated scorer, separate records with comma (e.g. --factor "0|2,1").
2012-02-28 02:27:23 +01:00
Tetsuo Kiso
d1292d4d11 Merge branch 'fix-tuning-subset-features' 2012-02-28 00:36:34 +09:00
Tetsuo Kiso
3878135f8b Fix a mistake in a previous commit: tuning on a subset of features.
In the commit 4b6232b757,
I thought I had fixed the bug around the tuning on a subset of
features by checking whether pdim and the length of the
active features which you want to optimize in the tuning.

However, it was wrong. I should set Point::optindices
appropriately according to specified the subset.
2012-02-28 00:35:42 +09:00
Rico Sennrich
230b93148c tmpdir option and bugfix to reordering 2012-02-27 14:11:47 +01:00
Hieu Hoang
205c1a868b Merge branch 'master' of github.com:moses-smt/mosesdecoder 2012-02-27 13:08:41 +00:00
Tetsuo Kiso
cd7855cd58 Fix compiling mert: add a missed header. 2012-02-27 18:50:27 +09:00
Tetsuo Kiso
361a9f8e2c Fix memory leaks.
- The Scorer and ScoreData objects allocated by the new
  operator are now released using the ScopedVector class.

- Add 'virtual' to inherited functions from the Scorer
  class.
2012-02-27 14:30:37 +09:00
Tetsuo Kiso
3b847f2025 Merge branch 'master' of github.com:moses-smt/mosesdecoder 2012-02-27 08:35:09 +09:00
Tetsuo Kiso
52acd9c3a8 Change mert/Timer.
- Add a high resolution timing function to measure the
  wall-clock time by gettimeofday().

- Now the Timer class use getrusage() to measure the elapsed
  CPU time as KenLM does.

- Revive Timer::restart().

- Add Timer::ToString() for reporting the detail statistics
  as well as for debugging.

- Add a simple unit test for Timer.
2012-02-27 08:34:51 +09:00
Matous Machacek
19f0f4ebe9 Change of evaluator usage (see mert/evaluator --help). 2012-02-26 23:04:02 +01:00
Matous Machacek
29a1b790bc Check of the number of weights in InterpolatedScorer 2012-02-26 22:52:20 +01:00
Matous Machacek
ceb70ec00c Fix small bugs (info is printed to cerr) 2012-02-26 22:23:57 +01:00