Skip to content
This repository was archived by the owner on Jul 7, 2021. It is now read-only.

Commit debdabc

Browse files
author
Ferit Tunçer
committed
2 parents 72131ec + 2d3a8c2 commit debdabc

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

README.md

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ITU Turkish NLP Pipeline Caller
2-
A command-line tool for using [ITU Turkish NLP Pipeline API](http://tools.nlp.itu.edu.tr/)
2+
A tool to use [ITU Turkish NLP Pipeline API](http://tools.nlp.itu.edu.tr/)
33

44
[![Build Status](https://travis-ci.org/ferittuncer/ITU-Turkish-NLP-Pipeline-Caller.svg?branch=master)](https://travis-ci.org/ferittuncer/ITU-Turkish-NLP-Pipeline-Caller)
55

@@ -14,33 +14,51 @@ of the European Chapter of the Association for Computational Linguistics
1414
of Turkish. Computational Linguistics, 34 no.3, 2008. ](http://www.mitpressjournals.org/doi/pdf/10.1162/coli.2008.07-017-R1-06-83)
1515

1616
## Usage
17-
To be able to use the pipeline, you need an authentication token(details on API web page).
18-
The tool reads the token from `pipeline.token` file(under the same directory with the tool) by default.
17+
To be able to use the pipeline, you need an authentication token (details on API web page).
1918

20-
`pipeline.caller.py filename`
21-
reads input file <filename>, prints the output under `./pipeline_caller_output/output<%system_time>`
19+
### As a Command Line Tool
20+
The tool reads the token from `pipeline.token` file (under the same directory with the tool) by default.
21+
22+
Simply
23+
`python3 ./pipeline.caller.py filename`
24+
reads input file <filename>, prints the output under `./output/output<system_time>`
2225

2326
You can select the pipeline tool by using -t option
24-
`pipeline.caller.py filename -t <tool name>`
27+
`python3 ./pipeline.caller.py filename -t <tool_name>`
2528
default is "pipelineNoisy"
2629

2730
You can force the encoding for I/O by using -e option
28-
`pipeline.caller.py filename -e <encoding>`
31+
`python3 ./pipeline.caller.py filename -e <encoding>`
2932
default is your system locale
3033

3134
And you can change the output directory by using -o option
32-
`pipeline.caller.py filename -o another_directory`
35+
`python3 ./pipeline.caller.py filename -o another_directory`
3336
default is "pipeline_caller_output"
3437

35-
## Defaults
38+
Also `python3 ./pipeline.caller.py --help` show the help menu.
39+
### Importing As a Module
40+
41+
`import pipeline_caller`
42+
43+
`caller = pipeline_caller.PipelineCaller()`
44+
45+
`result = caller.call(<tool_name>, <text>, <api_token>)`
3646

37-
Check DEFAULTS block in the source code if you need to change one of these:
47+
## Defaults (Optional)
48+
49+
Check DEFAULTS block in the source code if you need (generally, you don't) to change one of these:
3850

3951
`api_url = "http://tools.nlp.itu.edu.tr/SimpleApi"`
4052

4153
`pipeline_encoding = 'UTF-8'`
4254

43-
`token_path = "pipeline.token"`
55+
`token_path = "pipeline.token"` for command line tool
56+
57+
`default_output_dir = "output"`
58+
59+
`default_enconding = locale.getpreferredencoding(False)` default encoding in your OS, for I/O operations in command line tool
60+
61+
`default_separator_char_class = "[\.\?:;!]"` for command line tool, to separate sentences and process sentence by sentence
4462

4563
## Author, Copyright & License
4664

0 commit comments

Comments
 (0)