-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
Sqlalchemy adapter #693
Sqlalchemy adapter #693
Conversation
…sponse , and setting to lower case fuzz.ratio, sometimes the is not close enough to the right answer (my point of view).
…sponse , and setting to lower case fuzz.ratio, sometimes the is not close enough to the right answer (my point of view).
* upstream: Language fix and nltk fix to find correct library Fix test missing parameter. Add unit test to make sure that extra data is saved to the input statement. pass through extra data from the original input Add Gitter badge Fix broken link to "trainer classes on github" Renamed corpus readme files. Removed wiki link from readme. Fix arguments (+input_statement, statement_list) for most_frequent_response , and setting to lower case fuzz.ratio, sometimes the is not close enough to the right answer (my point of view). Update readme.md Update readme-es.md Update readme.pt.md Added Flask example link twitter adapter documentation
…sponse , and setting to lower case fuzz.ratio, sometimes the is not close enough to the right answer (my point of view).
assert method for None checks
minor typo
navyad/method wrappers
* upstream/master: (57 commits) Added views and settings to Django documentation. Update tests now that get_response returns an object. Remove output format setter from base test case. Removed language filter. Added filter test case for reperitive response filter. Added base test case for chatbots using Mongo DB Make it easier to extend the base test case. Added query tests. Add test case for new mongo_to_object method. Create filter documentation. Add filters to the Mongo DB example. Finished creating two simple filters. Remove base query restriction from get_random Add a method to convert Mongo DB results into statement objects. Converted mongo adapter to use query builder. Make query support for storage adapters optional. Create all the filters. Added base query support to mongo adapter. Added classes for filter objects. Avoid problems in str.format() with char accents ... # Conflicts: # .gitignore
…o sqlalchemy-adapter * 'master' of https://github.com/gunthercox/ChatterBot: Cast response.content to a string Fix unit tests for Django 1.8 Update Django settings documentation. Allow Django app settings to override ChatterBot settings. Add name attribute to ChatBot. Use a docstring for autodoc detection. Update training excption message. Update training parameter for docs and examples. Document ChatterBot parameters. Removed unused variable. Training class can now be set as a string passed to the ChatBot constructor. Raise an exception if an invalid tie breaking method is used. Change read the docs links from latest to stable. Update documentation settings. Add a favicon to docs. Resized logo background to be square. Correct static image paths in docs. Correct autodoc warnings. Added style for docs search header. Moved testing documentation from the readme to the docs.
Finally ! |
# # properties={ | ||
# # 'statement': relationship(Statement, backref='response') | ||
# # }, ) | ||
# mapper(Statement, self.statement) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could remove these lines?
|
||
return results | ||
|
||
# def filter(self, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could remove these lines?
requirements.txt
Outdated
@@ -3,3 +3,5 @@ jsondatabase>=0.1.7,<1.0.0 | |||
nltk>=3.2.0,<4.0.0 | |||
pymongo>=3.3.0,<4.0.0 | |||
python-twitter>=3.0.0,<4.0.0 | |||
textblob>=0.11.0,<0.12.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you imported this package? I haven't seen
chatterbot/storage/__init__.py
Outdated
@@ -2,3 +2,9 @@ | |||
from .django_storage import DjangoStorageAdapter | |||
from .jsonfile import JsonFileStorageAdapter | |||
from .mongodb import MongoDatabaseAdapter | |||
|
|||
# FIXME Better way manage import | |||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these files are static and reside in same directory as long as they are. It's always a safe import.
return Response(text=self.text, **occ) | ||
|
||
|
||
# # relational table TO REMOVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you could remove these lines
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Over all looks good, I think left over part is updating docs
…nd imports in requirements.txt, change imports in sqlalchemy and a little refactor.
Hi @vkosuri , Indeed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davizucon This looks good. I'm going to pull it in as an undocumented beta-level feature. Much appreciation for all of your work getting this put together.
there is any way to see exemple using sqlalchemy ? |
Hi @addelll, you can use this storage adapter the same way that the others are used. For example, chatbot = ChatBot(
"My ChatterBot",
storage_adapter="chatterbot.storage.SQLAlchemyDatabaseAdapter"
) Is this what you are looking for as an example? |
AttributeError: module 'chatterbot.storage' has no attribute 'SQLAlchemyDatabaseAdapter' ??? |
The reason you are seeing that message is likely because the current version of ChatterBot ( |
so any suggestions or i must copy directly from github ?? |
One possible way is to install directly from GitHub.
|
Thanks @gunthercox but some errors : |
@addelll I believe you will need to set |
@gunthercox @addelll , Sorry, I'll update documentation, asap. |
@gunthercox @davizucon thanks for the greate work , i need one full exemple using Sqlalchemy adapter because i have some errors after second release in heroku like |
This is the very first release of Sqlalchemy adapter, that have SQLite as default implementation, remains in alpha.
Thanks,
Davi