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
1414of 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
2326You 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 >`
2528default is "pipelineNoisy"
2629
2730You 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>`
2932default is your system locale
3033
3134And 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`
3336default 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