Skip to content

Commit

Permalink
Update model paths to use the new directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
bab2min committed Oct 3, 2024
1 parent a799d3a commit 8d945ce
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 53 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/arm64_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
- name: Test
run: |
./build/test/kiwi-test
mkdir eval_results && ./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt -o eval_results/ && ./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt --sbg -o eval_results/
mkdir eval_results && ./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/ && ./build/kiwi-evaluator -m ./models/base eval_data/*.txt --sbg -o eval_results/
cp -r build /artifacts/
cp -r eval_results /artifacts/
- name: Benchmark
run: |
curl -OL https://latina.bab2min.pe.kr/_data/kowiki1000.txt
KIWI_ARCH_TYPE=none ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=balanced ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=none ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=balanced ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
- name: Archive binaries
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ jobs:
- name: Run Evaluator
run: |
mkdir eval_results
./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt -o eval_results/
./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt --sbg -o eval_results/
./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/
./build/kiwi-evaluator -m ./models/base eval_data/*.txt --sbg -o eval_results/
- run: tar -zcvf arts.tgz build/*kiwi* build/test/*kiwi* eval_results/*.txt build/bindings/java/*.jar
- name: Archive binaries
uses: actions/upload-artifact@v3
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ jobs:
- name: Run Evaluator
run: |
mkdir eval_results
./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt -o eval_results/
./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt --sbg -o eval_results/
./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/
./build/kiwi-evaluator -m ./models/base eval_data/*.txt --sbg -o eval_results/
- name: Run Benchmark
run: |
curl -OL https://latina.bab2min.pe.kr/_data/kowiki1000.txt
./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=none ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=balanced ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=none ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=balanced ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
if [ "${{ matrix.arch }}" = "x86_64" ]; then
KIWI_ARCH_TYPE=sse2 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=sse4_1 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out --typos 6 kowiki1000.txt
KIWI_ARCH_TYPE=sse2 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=sse4_1 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./models/base -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./models/base -e -o test.out --typos 6 kowiki1000.txt
else
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out --typos 6 kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./models/base -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=neon ./build/kiwi-cli-* -m ./models/base -e -o test.out --typos 6 kowiki1000.txt
fi
- name: Archive binaries
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ppc64le_centos7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Release -DKIWI_USE_MIMALLOC=0 -DKIWI_JAVA_BINDING=1 ..
make -j2 && popd
./build/test/kiwi-test
mkdir eval_results && ./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt -o eval_results/ && ./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt --sbg -o eval_results/
mkdir eval_results && ./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/ && ./build/kiwi-evaluator -m ./models/base eval_data/*.txt --sbg -o eval_results/
cp -r build /artifacts/
cp -r eval_results /artifacts/
- name: Archive binaries
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
asset_name: kiwi-java-${{ steps.get_release.outputs.tag_name }}-mac-${{ matrix.arch }}.jar
asset_content_type: application/octet-stream
- if: matrix.arch == 'arm64'
run: tar -zcvf model.tgz ModelGenerator/sj.* ModelGenerator/extract.mdl ModelGenerator/*.dict ModelGenerator/combiningRule.txt ModelGenerator/skipbigram.mdl
run: tar -zcvf model.tgz models/base/sj.* models/base/extract.mdl models/base/*.dict models/base/combiningRule.txt models/base/skipbigram.mdl
- name: Upload release binary
if: matrix.arch == 'arm64'
uses: actions/[email protected]
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
mkdir build && pushd build && cmake -DCMAKE_BUILD_TYPE=Release -DKIWI_USE_MIMALLOC=0 -DKIWI_JAVA_BINDING=1 ..
make -j2 && popd
./build/test/kiwi-test
mkdir eval_results && ./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt -o eval_results/
mkdir eval_results && ./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/
cd build
mkdir include && mkdir lib && mkdir bin
mv libkiwi* lib/
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ jobs:
- name: Run Evaluator
run: |
mkdir eval_results
./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt -o eval_results/
./build/kiwi-evaluator -m ./ModelGenerator eval_data/*.txt --sbg -o eval_results/
./build/kiwi-evaluator -m ./models/base eval_data/*.txt -o eval_results/
./build/kiwi-evaluator -m ./models/base eval_data/*.txt --sbg -o eval_results/
- name: Run Benchmark
run: |
curl -OL https://latina.bab2min.pe.kr/_data/kowiki1000.txt
./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=none ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=balanced ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=sse2 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=sse4_1 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx512bw ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx512bw ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=avx512bw ./build/kiwi-cli-* -m ./ModelGenerator -e -o test.out --typos 6 kowiki1000.txt
./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=none ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=balanced ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=sse2 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=sse4_1 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx2 ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx512bw ./build/kiwi-cli-* -m ./models/base -e -o test.out kowiki1000.txt
KIWI_ARCH_TYPE=avx512bw ./build/kiwi-cli-* -m ./models/base -e -o test.out --sbg kowiki1000.txt
KIWI_ARCH_TYPE=avx512bw ./build/kiwi-cli-* -m ./models/base -e -o test.out --typos 6 kowiki1000.txt
- name: Archive binaries
uses: actions/upload-artifact@v3
with:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ jobs:
- name: Run Evaluator
run: |
mkdir eval_results
.\build\Release\kiwi-evaluator.exe -m .\ModelGenerator (Get-ChildItem eval_data\*.txt | Select-Object -Expand FullName) -o eval_results\
.\build\Release\kiwi-evaluator.exe -m .\ModelGenerator --sbg (Get-ChildItem eval_data\*.txt | Select-Object -Expand FullName) -o eval_results\
.\build\Release\kiwi-evaluator.exe -m .\models\base (Get-ChildItem eval_data\*.txt | Select-Object -Expand FullName) -o eval_results\
.\build\Release\kiwi-evaluator.exe -m .\models\base --sbg (Get-ChildItem eval_data\*.txt | Select-Object -Expand FullName) -o eval_results\
- name: Archive binaries
uses: actions/upload-artifact@v3
with:
Expand All @@ -59,21 +59,21 @@ jobs:
- name: Run Benchmark
run: |
curl -OL https://latina.bab2min.pe.kr/_data/kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out kowiki1000.txt
$env:KIWI_ARCH_TYPE = 'none'
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out kowiki1000.txt
$env:KIWI_ARCH_TYPE = 'balanced'
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out kowiki1000.txt
$env:KIWI_ARCH_TYPE = 'sse2'
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out kowiki1000.txt
if ( '${{ matrix.arch }}' -eq 'x64' )
{
$env:KIWI_ARCH_TYPE = 'sse4_1'
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out kowiki1000.txt
$env:KIWI_ARCH_TYPE = 'avx2'
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out kowiki1000.txt
$env:KIWI_ARCH_TYPE = 'avx512bw'
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out kowiki1000.txt
}
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out --sbg kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\ModelGenerator -e -o test.out --typos 6 kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out --sbg kowiki1000.txt
.\build\Release\kiwi-cli-*.exe -m .\models\base -e -o test.out --typos 6 kowiki1000.txt
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ $ ldconfig

설치가 잘 됐는지 확인하기 위해서는 `kiwi-evaluator`를 실행해봅니다.
```console
$ ./kiwi-evaluator --model ../ModelGenerator ../eval_data/* --sbg
$ ./kiwi-evaluator --model ../models/base ../eval_data/* --sbg
Loading Time : 981.745 ms
ArchType : avx2
LM Size : 34.1853 MB
Expand Down Expand Up @@ -110,7 +110,7 @@ Avg Score

0.13.0 버전부터 추가된 오타 교정 기능이 잘 작동하는지 확인하기 위해서는 다음과 같이 실행합니다.
```console
$ ./kiwi-evaluator --model ../ModelGenerator ../eval_data/* --sbg --typo 6
$ ./kiwi-evaluator --model ../models/base ../eval_data/* --sbg --typo 6
Loading Time : 9414.45 ms
ArchType : avx2
LM Size : 34.1853 MB
Expand Down
4 changes: 2 additions & 2 deletions bindings/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ KiwiJava의 jar 파일은 자체적으로 실행 가능한 main함수를 가지

# 모델 파일 다운로드
$ wget https://github.com/bab2min/Kiwi/releases/download/v0.16.0/kiwi_model_v0.16.0_base.tgz
$ tar -zxvf kiwi_model_v0.16.0_base.tgz # 압축 해제. 모델을 포함한 ModelGenerator라는 폴더가 생성됨
$ tar -zxvf kiwi_model_v0.16.0_base.tgz # 압축 해제. 모델을 포함한 models/base라는 폴더가 생성됨

# KiwiJava 다운로드
$ wget https://github.com/bab2min/Kiwi/releases/download/v0.16.1/kiwi-java-v0.16.1-lnx-x86-64.jar
Expand All @@ -21,7 +21,7 @@ $ wget https://github.com/bab2min/Kiwi/releases/download/v0.16.1/kiwi-java-v0.16
# 즉, kiwi_model_v0.16.0은 kiwi-java-v0.16.* 전부에서 사용가능합니다.

# jar 구동. 구동 인자로 모델 경로를 입력해주어야 함
$ java -jar kiwi-java-v0.16.1-lnx-x86-64.jar ModelGenerator/
$ java -jar kiwi-java-v0.16.1-lnx-x86-64.jar models/base/
Kiwi 0.16.1 is loaded!
>> 안녕하세요?
[Token(form=안녕, tag=NNG, position=0, length=2),
Expand Down
2 changes: 1 addition & 1 deletion bindings/java/kr/pe/bab2min/KiwiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

public class KiwiTest {

private static String modelPath = "../../ModelGenerator";
private static String modelPath = "../../models/base";
private static Kiwi reusableInst = null;

Kiwi getReusableKiwi() throws Exception {
Expand Down
2 changes: 1 addition & 1 deletion bindings/wasm/package-demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy';
import { requiredModelFiles } from './src/modelFiles';

const targets = requiredModelFiles.map((file) => ({
src: '../../../ModelGenerator/' + file,
src: '../../../models/base/' + file,
dest: 'model',
}));

Expand Down
2 changes: 1 addition & 1 deletion include/kiwi/capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ DECL_DLL int kiwi_typo_close(kiwi_typo_h handle);
/**
* @brief KiwiBuilder를 거치지 않고 바로 Kiwi instance를 생성합니다.
*
* @param model_path 모델이 들어있는 디렉토리 경로 (e.g., ./ModelGenerator).
* @param model_path 모델이 들어있는 디렉토리 경로 (e.g., ./models/base).
* @param num_threads 사용할 쓰레드의 수 (0일 경우, 자동으로 설정).
* @param options 생성 옵션. KIWI_BUILD_* 참조.
* @return Kiwi의 핸들.
Expand Down
2 changes: 1 addition & 1 deletion test/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <iostream>
#include <fstream>

#define MODEL_PATH "./ModelGenerator"
#define MODEL_PATH "./models/base"
#define KWORD u"킼윜"
#define KWORD8 u8"킼윜"

Expand Down
2 changes: 1 addition & 1 deletion tools/evaluator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ int main(int argc, const char* argv[])
{
CmdLine cmd{ "Kiwi evaluator" };

ValueArg<string> model{ "m", "model", "Kiwi model path", false, "ModelGenerator", "string" };
ValueArg<string> model{ "m", "model", "Kiwi model path", false, "models/base", "string" };
ValueArg<string> output{ "o", "output", "output dir for evaluation errors", false, "", "string" };
SwitchArg noNormCoda{ "", "no-normcoda", "without normalizing coda", false };
SwitchArg noZCoda{ "", "no-zcoda", "without z-coda", false };
Expand Down

0 comments on commit 8d945ce

Please sign in to comment.