GithubHelp home page GithubHelp logo

nerpp's Introduction

#nerpp --- Named Entity Recognition Using CRF++ and C++

Named Entity Recognition Using CRF++ and C++

To run this code, you should have

##Compile & Run

  • Download CRF++

  • Put CRF++-0.58folder into ```nerpp`` folder

  • Install CRF++ by running:

cd CRF++-0.58
./configure 
make
sudo make install
  • Compile by running:
cmake .
make
  • Run:
./nerpp x
  • where x is run mode:

    • 1: Train model (read file)
    • 2: Batch test (read file)
    • 3: Single sentence test (stdin)
    • 4: Split data file into 2 files, for training and testing
  • Example: With the given data in ./dataset/, first split data into 2 parts by:

./nerpp 4
dataset/data 0.8

Then train a model using the 80% of data:

./nerpp 1
dataset/data_TR

Test model using the 20% of data (result will be automatically saved in data_TS_info.txt:

./nerpp 2
dataset/data_TS

Test single sentence from stdin:

./nerpp 3
i want to see sport news on newspaper

##Structure and Algorithm See An Introduction to Conditional Random Fields for Relational Learning. See my tech-blog.

##TODO ...

##CRF++ LICENSE CRF++ is licensed under LGPL / BSD Licenses.

The MIT License (MIT)

Copyright (c) 2014 Xingdi (Eric) Yuan

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

nerpp's People

Contributors

xingdi-eric-yuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nerpp's Issues

make failed~

envy@ub1404envy:/os_prj/github/_crf/nerpp$ cmake .
-- The C compiler identification is GNU 4.8.4
-- The CXX compiler identification is GNU 4.8.4
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/envy/os_prj/github/_crf/nerpp
envy@ub1404envy:
/os_prj/github/_crf/nerpp$
envy@ub1404envy:/os_prj/github/_crf/nerpp$
envy@ub1404envy:
/os_prj/github/_crf/nerpp$
envy@ub1404envy:/os_prj/github/_crf/nerpp$
envy@ub1404envy:
/os_prj/github/_crf/nerpp$
envy@ub1404envy:/os_prj/github/_crf/nerpp$ make
Scanning dependencies of target nerpp
[ 33%] Building CXX object CMakeFiles/nerpp.dir/src/helper.cc.o
In file included from /usr/include/c++/4.8/unordered_map:35:0,
from /home/envy/os_prj/github/_crf/nerpp/src/general_settings.h:4,
from /home/envy/os_prj/github/_crf/nerpp/src/helper.h:4,
from /home/envy/os_prj/github/_crf/nerpp/src/helper.cc:1:
/usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the
^
/home/envy/os_prj/github/_crf/nerpp/src/helper.cc: In function ‘void readPredData(std::string, std::vectorstd::vector&)’:
/home/envy/os_prj/github/_crf/nerpp/src/helper.cc:6:25: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(std::string&)’
ifstream infile(path);
^
/home/envy/os_prj/github/_crf/nerpp/src/helper.cc:6:25: note: candidates are:
In file included from /home/envy/os_prj/github/_crf/nerpp/src/helper.h:2:0,
from /home/envy/os_prj/github/_crf/nerpp/src/helper.cc:1:
/usr/include/c++/4.8/fstream:467:7: note: std::basic_ifstream<_CharT, Traits>::basic_ifstream(const char, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::Ios_Openmode]
basic_ifstream(const char
__s, ios_base::openmode _mode = ios_base::in)
^
/usr/include/c++/4.8/fstream:467:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string}’ to ‘const char

/usr/include/c++/4.8/fstream:453:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/4.8/fstream:453:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/4.8/fstream:427:11: note: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/4.8/fstream:427:11: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string}’ to ‘const std::basic_ifstream&’
/home/envy/os_prj/github/_crf/nerpp/src/helper.cc: In function ‘void readData(std::string, std::vectorstd::vector&)’:
/home/envy/os_prj/github/_crf/nerpp/src/helper.cc:35:25: error: no matching function for call to ‘std::basic_ifstream::basic_ifstream(std::string&)’
ifstream infile(path);
^
/home/envy/os_prj/github/_crf/nerpp/src/helper.cc:35:25: note: candidates are:
In file included from /home/envy/os_prj/github/_crf/nerpp/src/helper.h:2:0,
from /home/envy/os_prj/github/_crf/nerpp/src/helper.cc:1:
/usr/include/c++/4.8/fstream:467:7: note: std::basic_ifstream<_CharT, Traits>::basic_ifstream(const char, std::ios_base::openmode) [with _CharT = char; _Traits = std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
basic_ifstream(const char* __s, ios_base::openmode _mode = ios_base::in)
^
/usr/include/c++/4.8/fstream:467:7: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string}’ to ‘const char

/usr/include/c++/4.8/fstream:453:7: note: std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT = char; _Traits = std::char_traits]
basic_ifstream() : __istream_type(), _M_filebuf()
^
/usr/include/c++/4.8/fstream:453:7: note: candidate expects 0 arguments, 1 provided
/usr/include/c++/4.8/fstream:427:11: note: std::basic_ifstream::basic_ifstream(const std::basic_ifstream&)
class basic_ifstream : public basic_istream<_CharT, _Traits>
^
/usr/include/c++/4.8/fstream:427:11: note: no known conversion for argument 1 from ‘std::string {aka std::basic_string}’ to ‘const std::basic_ifstream&’
/home/envy/os_prj/github/_crf/nerpp/src/helper.cc: In function ‘void splitData(std::string, double, std::string, std::string)’:
/home/envy/os_prj/github/crf/nerpp/src/helper.cc:85:44: error: ‘random_shuffle’ was not declared in this scope
random_shuffle(data.begin(), data.end());
^
make[2]: *
* [CMakeFiles/nerpp.dir/src/helper.cc.o] Error 1
make[1]: *** [CMakeFiles/nerpp.dir/all] Error 2
make: *** [all] Error 2
envy@ub1404envy:
/os_prj/github/_crf/nerpp$

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.