I am trying to use aws comprehend service using my localhosted jupyter notebook instance installed on windows10
- I have created IAM user and get the access key and secret and add them to credentials file
- I have also add the values of access key and secret into my windows environment vaiables
- My code is as following
comprehend = boto3.client('comprehend', region_name='us-west-2') phrases = comprehend.detect_key_phrases(Text=sample_review, LanguageCode='en') print('------- phrases ---------') for i in range(0, len(phrases['KeyPhrases'])): print((phrases['KeyPhrases'][i]['Text']))
and I am getting the following error
---------------------------------------------------------------------------
ClientError Traceback (most recent call last)
<ipython-input-24-03a1f42b1c9e> in <module>
2 comprehend = boto3.client('comprehend', region_name='us-west-2')
3 # Key phrases
----> 4 phrases = comprehend.detect_key_phrases(Text=sample_review, LanguageCode='en')
5
6 # Print the phrases:
c:\python39\lib\site-packages\botocore\client.py in _api_call(self, *args, **kwargs)
355 "%s() only accepts keyword arguments." % py_operation_name)
356 # The "self" in this scope is referring to the BaseClient.
--> 357 return self._make_api_call(operation_name, kwargs)
358
359 _api_call.__name__ = str(py_operation_name)
c:\python39\lib\site-packages\botocore\client.py in _make_api_call(self, operation_name, api_params)
674 error_code = parsed_response.get("Error", {}).get("Code")
675 error_class = self.exceptions.from_code(error_code)
--> 676 raise error_class(parsed_response, operation_name)
677 else:
678 return parsed_response
ClientError: An error occurred (InvalidSignatureException) when calling the DetectKeyPhrases operation: Signature not yet current: 20201126T001510Z is still later than 20201126T001452Z (20201126T000952Z + 5 min.)