forked from shoe/free_cite
-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
64 lines (45 loc) · 2.34 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Install instructions from a SuSE 10.1 development environment
== Install required packages ==
wget http://superb-west.dl.sourceforge.net/sourceforge/crfpp/CRF++-0.47.tar.gz
tar xvzf CRF++-0.47.tar.gz
cd CRF++-0.47
./configure && make && sudo make install
cd CRF++-0.47/ruby
ruby extconf.rb
make
sudo make install
If you are running fedora, you will have to take these additional steps:
su
echo "/usr/local/lib" > /etc/ld.so.conf.d/default-i386.conf
ldconfig
sudo gem install -v=2.3.14 rails
FreeCite should now work with any ActiveRecord supported database (Postgres, MySQL, SQLite, etc.)
== Train the model ==
# A trained model is checked in to the repo, so this step is not necessary
# unless you are making local changes.
> rake crfparser:train_model
== Using the API ==
http://0.0.0.0:3000/citations/create
* (required argument) citation or citation[] - a citation or array of
citations to parse
* Accept: text/xml or text/html
If accepting xml, returns the parsed citation string and resulting context
object in xml format.
If accepting html returns the parsed citation string as spans.
examples:
# in ruby:
require 'net/http'
Net::HTTP.start('localhost', 3000) do |http|
response = http.post('/citations/create',
'citation=A. Bookstein and S. T. Klein, Detecting content-bearing words by serial clustering, Proceedings of the Nineteenth Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 319327, 1995.',
'Accept' => 'text/xml')
puts "Code: #{response.code}"
puts "Message: #{response.message}"
puts "Body:\n #{response.body}"
end
# with curl
curl -H 'Accept: text/xml' -d "citation[]=Fielderman, A., Silvester, G., Gatsonis, C.A., Hoenig, J., Flynn, S. Prognostic significance of flow cytometric DNA analysis and proliferative index in stage I non-small cell lung cancer. American Review of Respiratory Disease, 1992; 146:707-710.&citation[]=Udvarhelyi, I.S., Gatsonis, C.A., Epstein, A.M., Pashos, C.L., Newhouse, J.P. and McNeil, B.J. Acute Myocardial Infarction in the Medicare population: process of care and clinical outcomes. Journal of the American Medical Association, 1992; 18:2530-2536. " http://0.0.0.0:3000/citations/create
== Using the Web App ==
http://0.0.0.0:3000/citations/create
Enter a citation, or a list of citations separated by newlines.
Should be self-explanatory.