Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify docs and convert rst to ipynb #1644

Merged
merged 25 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1a59449
Release 1.0.0
IgnatovFedor Nov 8, 2022
49e74be
Release 1.0.1
IgnatovFedor Nov 22, 2022
a1e9477
Release 1.0.2
IgnatovFedor Jan 10, 2023
8d8bdaf
Release 1.1.0
IgnatovFedor Feb 17, 2023
0448c73
Release 1.1.1
IgnatovFedor Mar 14, 2023
2731c71
unify docs and convert rst to ipynb
dmitrijeuseew May 12, 2023
d5ed330
add description of configs parameters and examples of training on cus…
dmitrijeuseew May 13, 2023
4e0e09b
add description of training on custom data for syntax parser and morp…
dmitrijeuseew May 14, 2023
fc82c32
fix docs
dmitrijeuseew May 24, 2023
b44be69
Merge remote-tracking branch 'origin/dev' into feat/unify_docs
dmitrijeuseew May 24, 2023
cfc99ab
update
dmitrijeuseew May 24, 2023
de31632
Merge remote-tracking branch 'origin/dev' into feat/unify_docs
dmitrijeuseew Jun 12, 2023
bac8eab
refactor docs
dmitrijeuseew Jun 12, 2023
1d482fa
update links
dmitrijeuseew Jun 12, 2023
e3e062a
docs: remove metadata from ipynb
IgnatovFedor Jun 14, 2023
2cbfbda
docs: cells joined
IgnatovFedor Jun 14, 2023
202bdda
remove: metadata
IgnatovFedor Jun 14, 2023
7384ce9
Merge remote-tracking branch 'origin/dev' into feat/unify_docs
dmitrijeuseew Jul 5, 2023
36b2201
update readme
dmitrijeuseew Jul 5, 2023
a19acb3
update kbqa.ipynb
dmitrijeuseew Jul 5, 2023
b025bb6
fix links in ipynb files
dmitrijeuseew Jul 5, 2023
ef6cd05
add google colab links
dmitrijeuseew Jul 5, 2023
959b9b4
refactor odqa docs
dmitrijeuseew Jul 5, 2023
50a042f
Add install
vaskonov Sep 25, 2023
e380916
fix: minor_fixes
IgnatovFedor Oct 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ Please leave us [your feedback](https://forms.gle/i64fowQmiVhMMC7f9) on how we c

**Models**

[Named Entity Recognition](http://docs.deeppavlov.ai/en/master/features/models/NER.html) | [Intent/Sentence Classification](http://docs.deeppavlov.ai/en/master/features/models/classifiers.html) |
[Named Entity Recognition](http://docs.deeppavlov.ai/en/master/features/models/NER.html) | [Intent/Sentence Classification](http://docs.deeppavlov.ai/en/master/features/models/classification.html) |

[Question Answering over Text (SQuAD)](http://docs.deeppavlov.ai/en/master/features/models/SQuAD.html) | [Knowledge Base Question Answering](http://docs.deeppavlov.ai/en/master/features/models/kbqa.html)
[Question Answering over Text (SQuAD)](http://docs.deeppavlov.ai/en/master/features/models/SQuAD.html) | [Knowledge Base Question Answering](http://docs.deeppavlov.ai/en/master/features/models/KBQA.html)

[Sentence Similarity/Ranking](http://docs.deeppavlov.ai/en/master/features/models/neural_ranking.html) | [TF-IDF Ranking](http://docs.deeppavlov.ai/en/master/features/models/tfidf_ranking.html)
[Sentence Similarity/Ranking](http://docs.deeppavlov.ai/en/master/features/models/neural_ranking.html) | [TF-IDF Ranking](http://docs.deeppavlov.ai/en/master/features/models/tfidf_ranking.html)

[Automatic Spelling Correction](http://docs.deeppavlov.ai/en/master/features/models/spelling_correction.html) | [Entity Linking](http://docs.deeppavlov.ai/en/master/features/models/entity_linking.html)
[Syntactic Parsing](http://docs.deeppavlov.ai/en/master/features/models/syntax_parser.html) | [Morphological Tagging](http://docs.deeppavlov.ai/en/master/features/models/morpho_tagger.html)

[Open Domain Questions Answering](http://docs.deeppavlov.ai/en/master/features/models/odqa.html) | [Russian SuperGLUE](http://docs.deeppavlov.ai/en/master/features/models/superglue.html)
[Automatic Spelling Correction](http://docs.deeppavlov.ai/en/master/features/models/spelling_correction.html) | [Entity Extraction](http://docs.deeppavlov.ai/en/master/features/models/entity_extraction.html)

[Open Domain Questions Answering](http://docs.deeppavlov.ai/en/master/features/models/ODQA.html) | [Russian SuperGLUE](http://docs.deeppavlov.ai/en/master/features/models/superglue.html)

[Relation Extraction](http://docs.deeppavlov.ai/en/master/features/models/relation_extraction.html)

**Embeddings**

Expand Down Expand Up @@ -179,7 +183,7 @@ from deeppavlov import evaluate_model
model = evaluate_model(<config_path>, install=True, download=True)
```

DeepPavlov also [allows](https://docs.deeppavlov.ai/en/master/features/python.html) to build a model from components for
DeepPavlov also [allows](https://docs.deeppavlov.ai/en/master/intro/python.html) to build a model from components for
inference using Python.

## License
Expand Down
9 changes: 7 additions & 2 deletions deeppavlov/models/kbqa/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,11 @@ def correct_variables(query_triplets: List[str], answer_ent: List[str], query_in
for j in range(len(triplet_elements)):
if triplet_elements[j] not in ent_var and triplet_elements[j].startswith("?"):
triplet_elements[j] = query_info["mid_var"]
break
if triplet_elements[j].startswith("?") \
and triplet_elements[j] not in [query_info["mid_var"], query_info["unk_var"]]:
triplet_elements[j] = query_info["unk_var"]
break
query_triplets[i] = " ".join(triplet_elements)
query_triplets[i] = query_triplets[i].replace(ent_var, query_info["unk_var"])
return query_triplets
Expand Down Expand Up @@ -174,8 +176,11 @@ def make_sparql_query(query_info: Tuple[List[str], List[str], List[str], Dict[st
query_triplets = [fill_slots(elem, entities, types, rels, delete_rel_prefix=True) for elem in query_triplets]
query_triplets = correct_variables(query_triplets, answer_ent, query_info_dict)
filled_queries = []
for triplets_p in list(itertools.permutations(query_triplets)):
filled_queries.append(query_from_triplets(triplets_p, answer_ent, query_info_dict))
if any(["qualifier" in filter_info_element for filter_info_element in filter_info]):
filled_queries.append(query_from_triplets(query_triplets, answer_ent, query_info_dict))
else:
for triplets_p in list(itertools.permutations(query_triplets)):
filled_queries.append(query_from_triplets(triplets_p, answer_ent, query_info_dict))
return filled_queries


Expand Down
Loading