Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
combo
Manage
Activity
Members
Labels
Plan
Issues
20
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Syntactic Tools
combo
Commits
82ba2f40
Commit
82ba2f40
authored
1 year ago
by
Maja Jablonska
Browse files
Options
Downloads
Patches
Plain Diff
Prediction.md and Troubleshooting.md
parent
451eaad5
1 merge request
!46
Merge COMBO 3.0 into master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/Prediction.md
+66
-0
66 additions, 0 deletions
docs/Prediction.md
docs/Troubleshooting.md
+13
-0
13 additions, 0 deletions
docs/Troubleshooting.md
with
79 additions
and
0 deletions
docs/Prediction.md
0 → 100644
+
66
−
0
View file @
82ba2f40
# Prediction
## COMBO as a Python library
The pre-trained models can be automatically downloaded with the
```from_pretrained```
method. Select a model name from the lists: UD-trained COMBO models and pass it as an argument of from_pretrained.
```
python
from
combo.predict
import
COMBO
nlp
=
COMBO
.
from_pretrained
(
"
model-prototype
"
)
sentence
=
nlp
(
"
Sentence to parse.
"
)
```
You can also load your own COMBO model:
```
python
from
combo.predict
import
COMBO
model_path
=
"
your_model.tar.gz
"
nlp
=
COMBO
.
from_pretrained
(
model_path
)
sentence
=
nlp
(
"
Sentence to parse.
"
)
```
COMBO allows to enter presegmented sentences (or texts):
```
python
from
combo.predict
import
COMBO
model_path
=
"
your_model.tar.gz
"
nlp
=
COMBO
.
from_pretrained
(
model_path
)
tokenized_sentence
=
[
"
Sentence
"
,
"
to
"
,
"
parse
"
,
"
.
"
]
sentence
=
nlp
([
tokenized_sentence
])
```
By default, COMBO uses the LAMBO tokenizer.
## COMBO as a command-line interface
Input and output are both in
```*.conllu```
format.
```
bash
combo
--mode
predict
--model_path
your_model_tar_gz
--input_file
your_conllu_file
--output_file
your_output_file
```
### Raw text prediction
Works for models where input was text-based only.
Input: one sentence per line.
Output: CONLL-u file.
```
bash
combo
--mode
predict
--model_path
your_model_tar_gz
--input_file
your_text_file
--output_file
your_output_file
--noconllu_format
```
### Console prediction
Works for models where input was text-based only.
Interactive testing in console (load model and just type sentence in console).
```
bash
combo
--mode
predict
--model_path
your_model_tar_gz
--input_file
"-"
```
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/Troubleshooting.md
0 → 100644
+
13
−
0
View file @
82ba2f40
# A few common problems
## Downloading a model
When downloading a model using the
```from_pretrained```
method, the downloaded file might be
incomplete, e.g. due to a network error. The following error:
```
EOFError: Compressed file ended before the end-of-stream marker was reached
```
means that the cache directory (by default
```$HOME/.combo```
) contains a corrupted file.
Deleting such a file and downloading the model again should help.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment