Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
courses:mapreduce-tutorial:step-14 [2012/01/26 23:16] straka |
courses:mapreduce-tutorial:step-14 [2012/01/31 16:08] (current) dusek |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== MapReduce Tutorial : Exercise - N-gram language model ====== | ====== MapReduce Tutorial : Exercise - N-gram language model ====== | ||
- | For a given //N// create a simple N-gram language model. You can experimenting on the following data: | + | For a given //N// create a simple N-gram language model. You can start experimenting on the following data: |
^ Path ^ Size ^ | ^ Path ^ Size ^ | ||
| / | | / | ||
Line 12: | Line 12: | ||
* Compute the unique words of the corpus, filter out the words that have only one occurrence, sort them according to the number of their occurrences and number them from 1. | * Compute the unique words of the corpus, filter out the words that have only one occurrence, sort them according to the number of their occurrences and number them from 1. | ||
* In order to represent //N//-gram, use the //N// numbers of the words, followed by a 0. Store the numbers using variable-length encoding (smaller numbers take less bytes) -- use '' | * In order to represent //N//-gram, use the //N// numbers of the words, followed by a 0. Store the numbers using variable-length encoding (smaller numbers take less bytes) -- use '' | ||
- | * One file of the resulting index should contain a sorted list of (N-gram representation, | + | * One file of the resulting index should contain a sorted list of (N-gram representation, |
- | * Every data file should also be accompanied by an index file, which contains every 1000-th //N-gram representation// | + | * Every data file should also be accompanied by an index file, which contains every 1000((You are free to choose better constant :--) ))-th //N-gram representation// |
* As in the sorting example, the //N-gram representation// | * As in the sorting example, the //N-gram representation// | ||
Try creating such index. Ideally, the sizes of resulting data files should be as equal as possible. | Try creating such index. Ideally, the sizes of resulting data files should be as equal as possible. | ||
+ | ---- | ||
+ | |||
+ | < | ||
+ | <table style=" | ||
+ | <tr> | ||
+ | <td style=" | ||
+ | <td style=" | ||
+ | <td style=" | ||
+ | </tr> | ||
+ | </ | ||
+ | </ |