Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Shallow-Parser-Evaluation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pruthwik mishra
Shallow-Parser-Evaluation
Commits
938d97a2
Commit
938d97a2
authored
Apr 26, 2022
by
Pruthwik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API Access
parent
46dae466
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
Codes-For-API-and-Evaluation/run_sampark_shallow_parser.py
Codes-For-API-and-Evaluation/run_sampark_shallow_parser.py
+25
-0
No files found.
Codes-For-API-and-Evaluation/run_sampark_shallow_parser.py
0 → 100644
View file @
938d97a2
"""Run Sampark shallow parser."""
# Language codes for passing onto the API, 3 lettered language identifier.
# Kannada - kan, Punjabi - pan, Urdu - urd, Telugu - tel, Hindi - hin
# if requests package is not there, do pip install requests
import
requests
import
json
url
=
"https://ssmt.iiit.ac.in/indic_shallow_parser_v1"
def
main
():
"""Pass arguments and call functions here."""
text
=
"भारतीय भाषा अनुवाद प्रणाली।
\n
भारतीय भाषा अनुवाद प्रणाली।"
# for multiple sentences, just join them by \n
out
=
{
"language"
:
"hin"
,
"text"
:
text
}
headers
=
{
'Content-type'
:
'application/json'
,
'Accept'
:
'text/plain'
}
r
=
requests
.
post
(
url
,
data
=
json
.
dumps
(
out
),
headers
=
headers
)
json_output
=
r
.
json
()
ssf_sent
=
json_output
[
'data'
]
print
(
ssf_sent
)
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment