Giter Site home page Giter Site logo

aprilspring / bi-lstm-crf-ner-tf2.0 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from saiwaiyanyu/bi-lstm-crf-ner-tf2.0

0.0 1.0 0.0 3.42 MB

Named Entity Recognition (NER) task using Bi-LSTM-CRF model implemented in Tensorflow 2.0(tensorflow2.0 +)

Python 100.00%

bi-lstm-crf-ner-tf2.0's Introduction

bi-lstm-crf-ner-tf2.0

Named Entity Recognition (NER) task using Bi-LSTM-CRF model implemented in Tensorflow2.0.

Requirements

  • python >3.6
  • tensorflow==2.0.0
  • tensorflow-addons==0.6.0

data

data example

1	B-TIME
9	I-TIME
9	I-TIME
7	I-TIME
年	E-TIME
,	O
是	O
中	B-LOC
国	E-LOC
发	O
展	O
历	O
史	O
上	O
非	O
常	O
重	O
要	O
的	O
很	O
不	O
平	O
凡	O
的	O
一	O
年	O
。	O
end

Usage

train

$ # pip install requirement.txt
$ python3 train.py

...
[-INFO-] 2019-12-05 21:11:15,037 24300 epoch   1, step 575, loss  5.0533 , accuracy --
[-INFO-] 2019-12-05 21:11:34,002 24300 epoch   1, step 576, loss  6.2023 , accuracy --
[-INFO-] 2019-12-05 21:11:52,543 24300 epoch   1, step 577, loss  4.3899 , accuracy --
[-INFO-] 2019-12-05 21:12:11,175 24300 epoch   1, step 578, loss  3.1313 , accuracy --
[-INFO-] 2019-12-05 21:12:29,661 24300 epoch   1, step 579, loss  6.4625 , accuracy --
[-INFO-] 2019-12-05 21:12:48,233 24300 epoch   1, step 580, loss  5.5159 , accuracy --
[-INFO-] 2019-12-05 21:12:48,325 24300 model saved
...

predict

$ python3 predict.py


input: ****总书记、国家主席***发表1998年新年讲话

[
    {
        "end": 4,
        "words": "****",
        "type": "ORG",
        "begin": 1
    },
    {
        "end": 15,
        "words": "***",
        "type": "PER",
        "begin": 13
    },
    {
        "end": 22,
        "words": "1998年",
        "type": "TIME",
        "begin": 18
    }
]

参考

https://zhuanlan.zhihu.com/p/88748460

bi-lstm-crf-ner-tf2.0's People

Contributors

saiwaiyanyu avatar aprilspring avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.