kaisekisan

package module
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 7, 2023 License: BSD-2-Clause Imports: 6 Imported by: 0

README

kaisekisan

Using Kagome v2. Thanks!

Warning 機械的に分類できますが、ちょっと違うかな?という分類をしてしまうことがあるので(自前のfilter関数がまだまだ充実していないため)、最後は人の目でチェックした方がいいです

Installation

Go
$ go install github.com/ddddddO/kaisekisan/cmd/kaisekisan@latest
Homebrew
$ brew install ddddddO/tap/kaisekisan
Scoop
$ scoop bucket add ddddddO https://github.com/ddddddO/scoop-bucket.git
$ scoop install ddddddO/kaisekisan
etc

download binary from here.

Usage

$ cat test.csv
no,text,description
0,テキスト,テキストです
1,天気,晴れがいい
2,千葉,県名
3,0120441222,電話番号
4,越智大貴,人です
5,神奈川県 川崎市,地名
6,千葉 真一,人名
7,IO999,idっぽいの
8,ts-9999,idっぽいの

$ kaisekisan test.csv 2
Succeeded! Destination -> /path/to/csv/test_out.csv

$ cat test_out.csv
no,text,classification,description
0,テキスト,一般,テキストです
1,天気,一般,晴れがいい
2,千葉,地域,県名
3,0120441222,数,電話番号
4,越智大貴,人名,人です
5,神奈川県 川崎市,地域,地名
6,千葉 真一,人名,人名
7,IO999,一般,idっぽいの
8,ts-9999,組織,idっぽいの
Learn more

このようなcsvファイルがあるとします。ファイル名は xxx.csv とします。

no,text,description
0,テキスト,テキストです
1,天気,晴れがいい
2,千葉,県名
3,0120441222,電話番号
4,越智大貴,人です
5,神奈川県 川崎市,地名
6,千葉 真一,人名
7,IO999,idっぽいの
8,ts-9999,idっぽいの

このcsvファイルの2列目text列の値がどんな単語であるか調べたいとします。 その場合、text列は2番目にあるので、

kaisekisan xxx.csv 2

として実行してみてください。すると、 xxx_out.csv が出来ます。(2はどの列を対象に解析するかを表わしています。)
中身はこのようになっています。

no,text,classification,description
0,テキスト,一般,テキストです
1,天気,一般,晴れがいい
2,千葉,地域,県名
3,0120441222,数,電話番号
4,越智大貴,人名,人です
5,神奈川県 川崎市,地域,地名
6,千葉 真一,人名,人名
7,IO999,一般,idっぽいの
8,ts-9999,組織,idっぽいの

xxx.csvと比較すると、text列の右隣にclassification列が追加されているのが分かります。 この列にtext列の単語の分類が入っています。 これだけだと見づらいので、スプレッドシートか何かにxxx_out.csvをインポートして、フィルター作成で並び替えしてみるとより見やすくなるかと思います。

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kaiseki

func Kaiseki(csvReader *csv.Reader, w io.Writer, columnNumber int) error

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL