-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from fractalego/development
Development
- Loading branch information
Showing
62 changed files
with
623 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import asyncio | ||
import os | ||
|
||
from unittest import TestCase | ||
from wafl.config import Configuration | ||
from wafl.connectors.remote.remote_entailer_connector import RemoteEntailerConnector | ||
from wafl.connectors.clients.entailer_client import EntailerClient | ||
|
||
_path = os.path.dirname(__file__) | ||
|
||
|
||
class TestConnection(TestCase): | ||
def test__entailer_connector(self): | ||
config = Configuration.load_local_config() | ||
connector = RemoteEntailerConnector(config) | ||
prediction = asyncio.run( | ||
connector.predict( | ||
"The first contact is a romance novel set in the middle ages.", | ||
"The first contact is a science fiction novel about the first contact between humans and aliens.", | ||
) | ||
) | ||
assert prediction["score"] < 0.5 | ||
|
||
def test__entailment_client(self): | ||
|
||
config = Configuration.load_local_config() | ||
client = EntailerClient(config) | ||
prediction = asyncio.run( | ||
client.get_entailment_score( | ||
"The first contact is a romance novel set in the middle ages.", | ||
"The first contact is a science fiction novel about the first contact between humans and aliens.", | ||
) | ||
) | ||
assert prediction < 0.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.