1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
|
%global _empty_manifest_terminate_build 0
Name: python-qary
Version: 0.7.27
Release: 1
Summary: A chatbot that assists rather than manipulates.
License: MIT
URL: https://gitlab.com/tangibleai/qary
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/01/b4/cb229eeda2f49c8fbbe2160e7d87d5c08bdcb61cc93f9e30ee1056127f01/qary-0.7.27.tar.gz
BuildArch: noarch
Requires: python3-pip
Requires: python3-poetry
Requires: python3-beautifulsoup4
Requires: python3-bleach
Requires: python3-bidict
Requires: python3-boto3
Requires: python3-botocore
Requires: python3-configargparse
Requires: python3-cython
Requires: python3-dataframe-image
Requires: python3-Django
Requires: python3-edit-distance
Requires: python3-elasticsearch
Requires: python3-environment
Requires: python3-gitpython
Requires: python3-graphviz
Requires: python3-h5py
Requires: python3-html5lib
Requires: python3-html2text
Requires: python3-huggingface-hub
Requires: python3-jupyter-console
Requires: python3-lxml
Requires: python3-m2r
Requires: python3-matplotlib
Requires: python3-matplotlib-inline
Requires: python3-meilisearch
Requires: python3-mistune
Requires: python3-nltk
Requires: python3-pandas
Requires: python3-pillow
Requires: python3-pronouncing
Requires: python3-psutil
Requires: python3-PyPDF2
Requires: python3-dotenv
Requires: python3-slugify
Requires: python3-pyyaml
Requires: python3-rapidfuzz
Requires: python3-recommonmark
Requires: python3-scikit-image
Requires: python3-scikit-learn
Requires: python3-scipy
Requires: python3-seaborn
Requires: python3-sentence_transformers
Requires: python3-spacy
Requires: python3-sphinx
Requires: python3-torch
Requires: python3-torchtext
Requires: python3-tox
Requires: python3-tqdm
Requires: python3-unidecode
Requires: python3-wikipedia
Requires: python3-babel
%description
[](https://buymeacoffee.com/hobs)
[](https://pypi.org/project/qary/)
[](https://pypi.python.org/pypi/qary/)
[](https://codecov.io/gl/tangibleai/qary)
[](https://www.digitalocean.com/?refcode=5bc34fba1bee&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge)
# `qary`
The `qary` package is both a chatbot framework and a virtual assistant that actually assists!
Most bots manipulate you to make money for their corporate masters. With qary, you can build **your** bot to protect you and amplify your prosocial intelligence.
We started work on `qary` as part of 1st editition of [NLP in Action](https://proai.org/nlpia2-book).
It has slowly grown into the core framework for a social-impact startup [Tangible AI](https://tangibleai.com).
Tangible AI [interns and volunteers](/docs/wiki/contributors.md) are constantly fixing bugs, adding new features and dialog trees to qary's repetoire.
The [San Diego Python User Group](https://www.pythonsd.org/index.html) meetups have been the scene for [some fun qary demos](https://piped.kavin.rocks/channel/UCXU-oZwaHnoYUhja_yrrrGg).
The [San Diego Machine Learning Book Club](https://www.meetup.com/San-Diego-Machine-Learning/) is a great place for support on advanced concepts in the _NLP in Action_ book or anything NLP and machine learning related.
You can find more ideas in `docs/`.
## Install
### Install from source
Retrieve the source code from GitLab using a bash console:
```bash
git clone git@gitlab.com:tangibleai/qary
cd qary
```
If that doesn't work or you don't know what a bash console is, then you probably want to start with the **Windows Users** Instructions here: [docs/README-windows-install.md](docs/README-windows-install.md)
Make sure you install `qary` in a _virtual environment_ using the latest version of `pip` and the python `virtualenv` package:
```bash
pip install --upgrade pip virtualenv
python -m virtualenv venv
source venv/bin/activate
```
Now that you have your environment activated, make sure you are in the `qary/` repository along side the pyproject.toml file so you can install qary in developer (editable) mode:
```bash
pip install --editable .
```
Now you're ready to run `qary` from the command line (bash console):
```bash
qary "Hi!"
```
### PyPi package
`qary` is on [PyPi](https://pypi.org/project/qary/) but this install is unlikely to work, unless you've already installed all the dependencies:
```bash
pip install qary
```
## Usage
```bash
$ qary --help
usage: qary [-h] [--version] [--name STR] [-p] [-s STR] [-v] [-vv] [words [words ...]]
```
### Running `qary` for just one skill
```bash
$ qary -s qa
# ... (logging messages)
YOU: When was Barack Obama born?
# ... (logging messages)
qary: August 4, 1961
```
### `qary` skills
`qary`'s probabilistic conversation manager chooses a reply from the possiblities generated by the different personalities:
- `pattern` (`skills/pattern.py`): example skill using regex patterns to reply to greetings like "hi"
- `qa` (`skills/qa.py`): BERT and ALBERT Wikipedia Question Answering (WikiQA reading comprehension tests)
- `faq` (`skills/faq.py`): answers to frequently asked questions using data/faq/*.yml
- `glossary` (`skills/glossary.py`): definitions from glossary yml files in data/faq/glossary-*.yml
- `eliza` (`eliza.py`): a python port of the ELIZA therapist bot
### Configuring default personalities
By default, `qary` runs with `qa` personality. Check out the config file in `qary.ini` to change the default skills loaded for your own custom skill in the skills directory.
## Approach
`qary`'s chatbot framework allows you to combine many approaches to give you state-of-the-art capability to answer questions and carry on a conversation:
1. search: [chatterbot](https://github.com/gunthercox/ChatterBot), [will](https://github.com/skoczen/will)
2. pattern matching and response templates: Alexa, [AIML](https://github.com/keiffster/program-y)
3. generative deep learning: [robot-bernie](https://github.com/nlpia/robot-bernie), [movie-bot](https://github.com/totalgood/nlpia/blob/master/src/nlpia/book/examples/ch10_movie_dialog_chatbot.py)
4. grounding: [snips](https://github.com/snipsco/snips-nlu)
It's all explained in detail at [NLP in Action](https://www.manning.com/books/natural-language-processing-in-action).
Presentations for San Diego Python User Group are in [docs/](/docs/2019-08-22--San Diego Python User Group -- How to Build a Chatbot.odp) and on the web at [http://totalgood.org/midata/talks](http://totalgood.org/midata/talks/)
## Contributing pattern for developers
DM @hobs on SD PUG's [discord server](https://discord.gg/yFTAQDxg) if you'd like to join us for weekly collaborative-coding sessions on `qary` and other open source projects.
1. [Create a fork](https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#creating-a-fork) of the [main qary repository](https://gitlab.com/tangibleai/qary) on Gitlab.
2. Make your changes in a branch named something different from `master`, e.g. create
a new branch `my-pull-request`.
3. [Create a merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html).
4. Help your fellow contributors out by:
- Follow the [PEP-8 style guide](https://www.python.org/dev/peps/pep-0008/).
- Try to include a docstring, at least a single line, in any function, method, or class
- Bonus points for adding a [doctest](https://docs.python.org/3/library/doctest.html) as part of your contribution.
- If you add a new feature, write some quick docs in the README.
- Add your name and attribution to the AUTHORS file.
- Know we are grateful for your contribution! You've made the chatbot world a little better!
%package -n python3-qary
Summary: A chatbot that assists rather than manipulates.
Provides: python-qary
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-qary
[](https://buymeacoffee.com/hobs)
[](https://pypi.org/project/qary/)
[](https://pypi.python.org/pypi/qary/)
[](https://codecov.io/gl/tangibleai/qary)
[](https://www.digitalocean.com/?refcode=5bc34fba1bee&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge)
# `qary`
The `qary` package is both a chatbot framework and a virtual assistant that actually assists!
Most bots manipulate you to make money for their corporate masters. With qary, you can build **your** bot to protect you and amplify your prosocial intelligence.
We started work on `qary` as part of 1st editition of [NLP in Action](https://proai.org/nlpia2-book).
It has slowly grown into the core framework for a social-impact startup [Tangible AI](https://tangibleai.com).
Tangible AI [interns and volunteers](/docs/wiki/contributors.md) are constantly fixing bugs, adding new features and dialog trees to qary's repetoire.
The [San Diego Python User Group](https://www.pythonsd.org/index.html) meetups have been the scene for [some fun qary demos](https://piped.kavin.rocks/channel/UCXU-oZwaHnoYUhja_yrrrGg).
The [San Diego Machine Learning Book Club](https://www.meetup.com/San-Diego-Machine-Learning/) is a great place for support on advanced concepts in the _NLP in Action_ book or anything NLP and machine learning related.
You can find more ideas in `docs/`.
## Install
### Install from source
Retrieve the source code from GitLab using a bash console:
```bash
git clone git@gitlab.com:tangibleai/qary
cd qary
```
If that doesn't work or you don't know what a bash console is, then you probably want to start with the **Windows Users** Instructions here: [docs/README-windows-install.md](docs/README-windows-install.md)
Make sure you install `qary` in a _virtual environment_ using the latest version of `pip` and the python `virtualenv` package:
```bash
pip install --upgrade pip virtualenv
python -m virtualenv venv
source venv/bin/activate
```
Now that you have your environment activated, make sure you are in the `qary/` repository along side the pyproject.toml file so you can install qary in developer (editable) mode:
```bash
pip install --editable .
```
Now you're ready to run `qary` from the command line (bash console):
```bash
qary "Hi!"
```
### PyPi package
`qary` is on [PyPi](https://pypi.org/project/qary/) but this install is unlikely to work, unless you've already installed all the dependencies:
```bash
pip install qary
```
## Usage
```bash
$ qary --help
usage: qary [-h] [--version] [--name STR] [-p] [-s STR] [-v] [-vv] [words [words ...]]
```
### Running `qary` for just one skill
```bash
$ qary -s qa
# ... (logging messages)
YOU: When was Barack Obama born?
# ... (logging messages)
qary: August 4, 1961
```
### `qary` skills
`qary`'s probabilistic conversation manager chooses a reply from the possiblities generated by the different personalities:
- `pattern` (`skills/pattern.py`): example skill using regex patterns to reply to greetings like "hi"
- `qa` (`skills/qa.py`): BERT and ALBERT Wikipedia Question Answering (WikiQA reading comprehension tests)
- `faq` (`skills/faq.py`): answers to frequently asked questions using data/faq/*.yml
- `glossary` (`skills/glossary.py`): definitions from glossary yml files in data/faq/glossary-*.yml
- `eliza` (`eliza.py`): a python port of the ELIZA therapist bot
### Configuring default personalities
By default, `qary` runs with `qa` personality. Check out the config file in `qary.ini` to change the default skills loaded for your own custom skill in the skills directory.
## Approach
`qary`'s chatbot framework allows you to combine many approaches to give you state-of-the-art capability to answer questions and carry on a conversation:
1. search: [chatterbot](https://github.com/gunthercox/ChatterBot), [will](https://github.com/skoczen/will)
2. pattern matching and response templates: Alexa, [AIML](https://github.com/keiffster/program-y)
3. generative deep learning: [robot-bernie](https://github.com/nlpia/robot-bernie), [movie-bot](https://github.com/totalgood/nlpia/blob/master/src/nlpia/book/examples/ch10_movie_dialog_chatbot.py)
4. grounding: [snips](https://github.com/snipsco/snips-nlu)
It's all explained in detail at [NLP in Action](https://www.manning.com/books/natural-language-processing-in-action).
Presentations for San Diego Python User Group are in [docs/](/docs/2019-08-22--San Diego Python User Group -- How to Build a Chatbot.odp) and on the web at [http://totalgood.org/midata/talks](http://totalgood.org/midata/talks/)
## Contributing pattern for developers
DM @hobs on SD PUG's [discord server](https://discord.gg/yFTAQDxg) if you'd like to join us for weekly collaborative-coding sessions on `qary` and other open source projects.
1. [Create a fork](https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#creating-a-fork) of the [main qary repository](https://gitlab.com/tangibleai/qary) on Gitlab.
2. Make your changes in a branch named something different from `master`, e.g. create
a new branch `my-pull-request`.
3. [Create a merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html).
4. Help your fellow contributors out by:
- Follow the [PEP-8 style guide](https://www.python.org/dev/peps/pep-0008/).
- Try to include a docstring, at least a single line, in any function, method, or class
- Bonus points for adding a [doctest](https://docs.python.org/3/library/doctest.html) as part of your contribution.
- If you add a new feature, write some quick docs in the README.
- Add your name and attribution to the AUTHORS file.
- Know we are grateful for your contribution! You've made the chatbot world a little better!
%package help
Summary: Development documents and examples for qary
Provides: python3-qary-doc
%description help
[](https://buymeacoffee.com/hobs)
[](https://pypi.org/project/qary/)
[](https://pypi.python.org/pypi/qary/)
[](https://codecov.io/gl/tangibleai/qary)
[](https://www.digitalocean.com/?refcode=5bc34fba1bee&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge)
# `qary`
The `qary` package is both a chatbot framework and a virtual assistant that actually assists!
Most bots manipulate you to make money for their corporate masters. With qary, you can build **your** bot to protect you and amplify your prosocial intelligence.
We started work on `qary` as part of 1st editition of [NLP in Action](https://proai.org/nlpia2-book).
It has slowly grown into the core framework for a social-impact startup [Tangible AI](https://tangibleai.com).
Tangible AI [interns and volunteers](/docs/wiki/contributors.md) are constantly fixing bugs, adding new features and dialog trees to qary's repetoire.
The [San Diego Python User Group](https://www.pythonsd.org/index.html) meetups have been the scene for [some fun qary demos](https://piped.kavin.rocks/channel/UCXU-oZwaHnoYUhja_yrrrGg).
The [San Diego Machine Learning Book Club](https://www.meetup.com/San-Diego-Machine-Learning/) is a great place for support on advanced concepts in the _NLP in Action_ book or anything NLP and machine learning related.
You can find more ideas in `docs/`.
## Install
### Install from source
Retrieve the source code from GitLab using a bash console:
```bash
git clone git@gitlab.com:tangibleai/qary
cd qary
```
If that doesn't work or you don't know what a bash console is, then you probably want to start with the **Windows Users** Instructions here: [docs/README-windows-install.md](docs/README-windows-install.md)
Make sure you install `qary` in a _virtual environment_ using the latest version of `pip` and the python `virtualenv` package:
```bash
pip install --upgrade pip virtualenv
python -m virtualenv venv
source venv/bin/activate
```
Now that you have your environment activated, make sure you are in the `qary/` repository along side the pyproject.toml file so you can install qary in developer (editable) mode:
```bash
pip install --editable .
```
Now you're ready to run `qary` from the command line (bash console):
```bash
qary "Hi!"
```
### PyPi package
`qary` is on [PyPi](https://pypi.org/project/qary/) but this install is unlikely to work, unless you've already installed all the dependencies:
```bash
pip install qary
```
## Usage
```bash
$ qary --help
usage: qary [-h] [--version] [--name STR] [-p] [-s STR] [-v] [-vv] [words [words ...]]
```
### Running `qary` for just one skill
```bash
$ qary -s qa
# ... (logging messages)
YOU: When was Barack Obama born?
# ... (logging messages)
qary: August 4, 1961
```
### `qary` skills
`qary`'s probabilistic conversation manager chooses a reply from the possiblities generated by the different personalities:
- `pattern` (`skills/pattern.py`): example skill using regex patterns to reply to greetings like "hi"
- `qa` (`skills/qa.py`): BERT and ALBERT Wikipedia Question Answering (WikiQA reading comprehension tests)
- `faq` (`skills/faq.py`): answers to frequently asked questions using data/faq/*.yml
- `glossary` (`skills/glossary.py`): definitions from glossary yml files in data/faq/glossary-*.yml
- `eliza` (`eliza.py`): a python port of the ELIZA therapist bot
### Configuring default personalities
By default, `qary` runs with `qa` personality. Check out the config file in `qary.ini` to change the default skills loaded for your own custom skill in the skills directory.
## Approach
`qary`'s chatbot framework allows you to combine many approaches to give you state-of-the-art capability to answer questions and carry on a conversation:
1. search: [chatterbot](https://github.com/gunthercox/ChatterBot), [will](https://github.com/skoczen/will)
2. pattern matching and response templates: Alexa, [AIML](https://github.com/keiffster/program-y)
3. generative deep learning: [robot-bernie](https://github.com/nlpia/robot-bernie), [movie-bot](https://github.com/totalgood/nlpia/blob/master/src/nlpia/book/examples/ch10_movie_dialog_chatbot.py)
4. grounding: [snips](https://github.com/snipsco/snips-nlu)
It's all explained in detail at [NLP in Action](https://www.manning.com/books/natural-language-processing-in-action).
Presentations for San Diego Python User Group are in [docs/](/docs/2019-08-22--San Diego Python User Group -- How to Build a Chatbot.odp) and on the web at [http://totalgood.org/midata/talks](http://totalgood.org/midata/talks/)
## Contributing pattern for developers
DM @hobs on SD PUG's [discord server](https://discord.gg/yFTAQDxg) if you'd like to join us for weekly collaborative-coding sessions on `qary` and other open source projects.
1. [Create a fork](https://docs.gitlab.com/ee/user/project/repository/forking_workflow.html#creating-a-fork) of the [main qary repository](https://gitlab.com/tangibleai/qary) on Gitlab.
2. Make your changes in a branch named something different from `master`, e.g. create
a new branch `my-pull-request`.
3. [Create a merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html).
4. Help your fellow contributors out by:
- Follow the [PEP-8 style guide](https://www.python.org/dev/peps/pep-0008/).
- Try to include a docstring, at least a single line, in any function, method, or class
- Bonus points for adding a [doctest](https://docs.python.org/3/library/doctest.html) as part of your contribution.
- If you add a new feature, write some quick docs in the README.
- Add your name and attribution to the AUTHORS file.
- Know we are grateful for your contribution! You've made the chatbot world a little better!
%prep
%autosetup -n qary-0.7.27
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-qary -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Wed May 17 2023 Python_Bot <Python_Bot@openeuler.org> - 0.7.27-1
- Package Spec generated
|