Im using the English trainer and i want the bot to answer my question with his best-match answer...
For some reason the bot answers with a retweet like so:
"RT KhaledAlwaleed THE BASIS OF ..."
I am using my own corpus dataset:
bot = ChatBot("Bot")
bot.set_trainer(ChatterBotCorpusTrainer)
bot.train("chatterbot.corpus.bot")
Where "chatterbot.corpus.bot" has only 5 questions and answers.
So sending him a long unrelated text to his dataset will confuse him but i was expecting an answer from the 5 answers available. How and why did he generate a RT retweet?!?!
How do i make him answer my provided answers only?
Thank you.
Related
I want to get user's response along with question from surveyGizmo. I am getting list of questions and possible answers.
But I want specific answer which user has given during survey.
https://restapi.surveygizmo.com/v5/survey/123456/surveyresponse?api_token='some token'
I can suggest solution, but only on python and missing some profit for you, becasue your task is not exact. It's a general way to print all answers. And you can choose that you need.
#needed packages
from surveygizmo import SurveyGizmo
import json
#auth
sg = SurveyGizmo(
api_version='v4',
response_type='json',
api_token = api_token,
api_token_secret = api_token_secret
)
#get data from your account as json (as I know json is optional)
answers = json.loads(sg.api.surveyresponse.list(surveyid, resultperpage=resultperpage, page=page)
#in answers['data'] are saved onlu responses
list_of_answers = answers['data']
#using loop you can get all answers on all questions
for answer_index in list_of_respondents:
for question_index, question_value in enumerate(list_of_answers[answer_index])
#SurveyGizmo data structure contains answers with labels like '[question(question_id), [option(option_id)' — that's why we need this 'if'
if question_value.startswith('[question'):
print(list_of_answers[answer_index][question_value])
Actually I'm working with it now and try to transfer all sg-data to sql like database and it makes me to do find simpliest ways to work. So f you give more information, I can make more profit for you.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I write a lot of applications in C# and I'm trying to sew up some holes in my standard practices.
Specifically, I'm trying to decide on the best text to use in a message box, and I thought I'd ask the StackOverflow community since I believe that many opinions are always better than one.
What I have currently is:
"Document XXX.docx already exists. Okay to overwrite?"
Buttons for; Yes, No and Cancel
I'm really interested to see which examples turn out to be the most popular.
There are no limits on the style used; formal, casual, humourous, etc. All suggestions are welcome. Aim to err safely within political correctness though.
On a small side note: It would also be great, but by no means essential, to consider that the same text could also be suitable for a command line program.
Please note: English language only please. For other languages, please raise a new question.
Personally, I like to see a bit more context and slightly different wording. Something like:
"<existing document name>" already exists in "<destination path>".
Would you like to replace it (Y/N)?
or perhaps with even more information:
"<existing document name>" (<bytes>) (<date modified>) already exists in
"<destination path>".
Would you like to replace it with file of size <new bytes>, last modified
<new date modified> (Y/N)?
I think "replace" is a bit more clear than "overwrite" - and (speculation) may translate into other languages, and maintain the intended meaning more often.
...and one last option with new file name/location info:
"<existing document name>" (<bytes>) (<date modified>) already exists in
"<destination path>".
Would you like to replace it with file "<new file name>" in "<new path>" of
size <new bytes>, last modified <new date modified> (Y/N)?
This last one would probably just show a temp file / buffer location for an initial file save--but it is reusable, and more meaningful when doing a file copy.
Hope you find one of these useful.
Cheers,
Hans
Title: Overwrite?
"XXX.docx exists.
Would you like to overwrite XXX.docx?"
Buttons: Overwrite, Keep, Panic
Simple solutions are usually best, for example windows user might find it familiar to see a message :
He has 3 options :
Replace
Abort action x3
Create with a new name
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I'm using web2py forms, but I need to set up a limit for 20 users registration. How can I do it?
PS: Edit to make easy to understand
Thanks in advance.
Best regards!
Assuming you wish to limit registration to a maximum of 20 users and you are using the standard /default/user function from the scaffolding application:
In the default.py controller:
def user():
if request.args(0) == 'register' and db.auth_user.count() >= 20:
form = None
else:
form = auth()
return dict(form=form)
In the default/user.html view:
{{if form is None:}}
<p>Sorry, no more registrations allowed.</p>
{{else:}}
{{=form}}
{{pass}}
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
I am looking for some statistical data on the usage of Unicode characters in textual documents (with any markup). Googling brought no results.
Background: I am currently developing a finite state machine-based text processing tool. Statistical data on characters might help searching for the right transitions. For instance latin characters are probably most used so it might make sense to check for those first.
Did anyone by chance gathered or saw such statistics?
(I'm not focused on specific languages or locales. Think general-purpose parser like an XML parser.)
To sum up current findings and ideas:
Tom Christiansen gathered such statistics for PubMed Open Access Corpus (see this question). I have asked if he could share these statistics, waiting for the answer.
As #Boldewyn and #nwellnhof suggested, I could run the analysis of the complete Wikipedia dump or CommonCrawl data. I think these are good suggestions, I'll probably go with the CommonCrawl.
So sorry, this is not an answer, but a good research direction.
UPDATE: I have written a small Hadoop job and ran it on one of the CommonCrawl segments. I have posted my results in a spreadsheet here. Below are the first 50 characters:
0x000020 14627262
0x000065 7492745 e
0x000061 5144406 a
0x000069 4791953 i
0x00006f 4717551 o
0x000074 4566615 t
0x00006e 4296796 n
0x000072 4293069 r
0x000073 4025542 s
0x00000a 3140215
0x00006c 2841723 l
0x000064 2132449 d
0x000063 2026755 c
0x000075 1927266 u
0x000068 1793540 h
0x00006d 1628606 m
0x00fffd 1579150
0x000067 1279990 g
0x000070 1277983 p
0x000066 997775 f
0x000079 949434 y
0x000062 851830 b
0x00002e 844102 .
0x000030 822410 0
0x0000a0 797309
0x000053 718313 S
0x000076 691534 v
0x000077 682472 w
0x000031 648470 1
0x000041 624279 #
0x00006b 555419 k
0x000032 548220 2
0x00002c 513342 ,
0x00002d 510054 -
0x000043 498244 C
0x000054 495323 T
0x000045 455061 E
0x00004d 426545 M
0x000050 423790 P
0x000049 405276 I
0x000052 393218 R
0x000044 381975 D
0x00004c 365834 L
0x000042 353770 B
0x000033 334689 E
0x00004e 325299 N
0x000029 302497 /
0x000028 301057 (
0x000035 298087 5
0x000046 295148 F
To be honest, I have no idea if these results are representative. As I said, I only analysed one segment. Looks quite plausible for me. One can also easily spot that the markup is already stripped off - so the distribution is not directly suitable for my XML parser. But it gives valuable hints on which character ranges to check first.
The link to http://emojitracker.com/ in the near-duplicate question I personally think is the most promising resource for this. I have not examined the sources (I don't speak Ruby) but from a real-time Twitter feed of character frequencies, I would expect quite a different result than from static web pages, and probably a radically different language distribution (I see lots more Arabic and Turkish on Twitter than in my otherwise ordinary life). It's probably not exactly what you are looking for, but if we just look at the title of your question (which probably most visitors will have followed to get here) then that is what I would suggest as the answer.
Of course, this begs the question what kind of usage you attempt to model. For static XML, which you seem to be after, maybe the Common Crawl set is a better starting point after all. Text coming out of an editorial process (however informal) looks quite different from spontaneous text.
Out of the suggested options so far, Wikipedia (and/or Wiktionary) is probably the easiest, since it's small enough for local download, far better standardized than a random web dump (all UTF-8, all properly tagged, most of it properly tagged by language and proofread for markup errors, orthography, and occasionally facts), and yet large enough (and probably already overkill by an order of magnitude or more) to give you credible statistics. But again, if the domain is different than the domain you actually want to model, they will probably be wrong nevertheless.
This question has been asked here: Which schema.org type should be used for a forum?
But this was 2 years back - was wondering if there were any other ideas of using schema.org for a forum.
Simple layout of the forum is:
Question - posted by xyz - date xx/yy/zzzz
Answer1 - posted by abc - date xx/yy/zzzz
Answer2 - posted by def - date xx/yy/zzzz
Answer3 - posted by ghi - date xx/yy/zzzz
and so on.
I know this is old but it appears that discussion forums may have found their way into the schema:
http://schema.org/DiscussionForumPosting
discussionUrl URL A link to the page containing the comments of the CreativeWork.
Each answer could be a http://www.schema.org/Comment:
A comment on an item - for example, a comment on a blog post. The comment's content is expressed via the "text" property, and its topic via "about", properties shared with all CreativeWorks.
The question could be the more general http://www.schema.org/CreativeWork (I don’t think that Article is appropriate, at least typically not).
(While this question is old, the answer is still as elusive)
It looks like it was proposed as http://www.w3.org/wiki/WebSchemas/DiscussionSchema (The page contains a PDF link with a breakdown of the elements and an example of use)