• Stars
    star
    132
  • Rank 272,691 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 3 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

自然言語で書かれた時間情報表現を抽出/規格化するルールベースの解析器

ja-timex

自然言語で書かれた時間情報表現を抽出/規格化するルールベースの解析器

概要

ja-timex は、現代日本語で書かれた自然文に含まれる時間情報表現を抽出しTIMEX3と呼ばれるアノテーション仕様に変換することで、プログラムが利用できるような形に規格化するルールベースの解析器です。

以下の機能を持っています。

  • ルールベースによる日本語テキストからの日付や時刻、期間や頻度といった時間情報表現を抽出
  • アラビア数字/漢数字、西暦/和暦などの多彩なフォーマットに対応
  • 時間表現のdatetime/timedeltaオブジェクトへの変換サポート

入力

from ja_timex import TimexParser

timexes = TimexParser().parse("彼は2008年4月から週に3回のジョギングを、朝8時から1時間行ってきた")

出力

[<TIMEX3 tid="t0" type="DATE" value="2008-04-XX" text="2008年4月">,
 <TIMEX3 tid="t1" type="SET" value="P1W" freq="3X" text="週に3回">,
 <TIMEX3 tid="t2" type="TIME" value="T08-XX-XX" text="朝8時">,
 <TIMEX3 tid="t3" type="DURATION" value="PT1H" text="1時間">]

datetime/timedeltaへの変換

# <TIMEX3 tid="t0" type="DATE" value="2008-04-XX" text="2008年4月">
In []: timexes[0].to_datetime()
Out[]: DateTime(2008, 4, 1, 0, 0, 0, tzinfo=Timezone('Asia/Tokyo'))
# <TIMEX3 tid="t3" type="DURATION" value="PT1H" text="1時間">
In []: timexes[3].to_duration()
Out[]: Duration(hours=1)

インストール

pip install ja-timex

ドキュメント

ja-timex documentation

参考仕様

本パッケージは、以下の論文で提案されている時間情報アノテーションの枠組みを元に作成しています。

More Repositories

1

pybitflyer

Python wrapper for bitFlyer's REST API.
Python
173
star
2

kanjivg-radical

Jupyter Notebook
93
star
3

emoji-ja

📙UNICODE絵文字の日本語読み/キーワード/分類辞書📙
Python
77
star
4

embedrank

Python Implementation of EmbedRank
Python
48
star
5

fastapi-ml-template

Python
40
star
6

pytorch_bert_japanese

Python
34
star
7

nayose-wikipedia-ja

Wikipediaから作成した日本語名寄せデータセット
Python
34
star
8

swem

Python implementation of SWEM (Simple Word-Embedding-based Methods)
Python
28
star
9

pretrained_doc2vec_ja

Python
26
star
10

wikipedia_es_similarity

Python
16
star
11

glyph-aware-character-embedding

Python
12
star
12

toji

Standalone web application for collecting a large amount of voices read aloud from the manuscript efficiently.
Python
10
star
13

alacarte_embedding

Python implementation of A La Carte Embedding
Python
9
star
14

spacy-ginza-ner-webapi

Python
7
star
15

yat

yat: Yet Another Tokenizer for Japanese NLP
Jupyter Notebook
7
star
16

manbyo-sudachi

Python
7
star
17

ec2inst

AWS EC2 instance console for CLI
Python
6
star
18

wed

Python implementation of Word Embedding based Edit Distance
Python
5
star
19

togofarmcamp

the crawler of http://togotv.dbcls.jp/
Ruby
4
star
20

ja-icd10

ICD-10 国際疾病分類の日本語情報を扱うためのPythonパッケージ
Python
4
star
21

wikipedia_graph_embedding

Python
4
star
22

mecabpr

Python
4
star
23

oov_magnitude_ja

Python
4
star
24

di-pyconjp2021

Jupyter Notebook
3
star
25

sif_embedding

A Python Implementation of SIF Embedding
Python
3
star
26

minify_w2v

Minify word2vec model file
Jupyter Notebook
2
star
27

all_but_the_top

Python
2
star
28

rte_snli

Jupyter Notebook
2
star
29

dotfiles

Shell
2
star
30

ringbar

Python
1
star
31

sleepdog

Slack bot for monitoring and notification of filesystem events
Python
1
star
32

faiss_cpu_gpu

Python
1
star
33

icd10_embeddings

Jupyter Notebook
1
star
34

blottan

Ruby
1
star
35

Heatmap

複数のtranscripts.tmapから遺伝子発現行列を作ります
Ruby
1
star