TextSense is a dynamic web application designed to streamline text analysis tasks. Enhancing AWS services, it efficiently extracts text from images, conducts sentiment analysis, and offers language translation capabilities.
Before running the application, ensure you have the following:
- Python installed on your system.
- AWS account with appropriate permissions and credentials.
- Boto3 library installed (
pip install boto3
).
- Clone this repository to your local machine.
- Install the required Python packages by running
pip install -r requirements.txt
. - Configure your AWS credentials by following the steps below:
-
Create an IAM User:
- Log in to the AWS Management Console.
- Go to the IAM service.
- Create a new IAM user with appropriate permissions(e.g. AdministratorAccess) for accessing AWS services like Textract, Comprehend, and Translate. Make sure to save the access key ID and secret access key generated during the user creation process.
-
Install AWS CLI:
- Install the AWS Command Line Interface (CLI) by running
pip install awscli
.
- Install the AWS Command Line Interface (CLI) by running
-
Configure AWS CLI:
- Run
aws configure --profile <IAM_USER_NAME>
in your terminal, replacing<IAM_USER_NAME>
with the name of your IAM user. - Enter the access key ID and secret access key when prompted.
- Choose the default region name (e.g.,
us-east-1
) and output format.
- Run
-
Update Flask Application:
- Replace
'IAM_USER_NAME'
with the profile name you used during AWS CLI configuration inapp.py
.
- Replace
-
Run Flask Application:
- Start the Flask application by running
python app.py
.
- Start the Flask application by running
- Access the application through your browser at
http://localhost:5000/
. - Upload an image file.
- After uploading, the extracted text will be displayed along with sentiment analysis results.
- Optionally, select a target language to translate the extracted text.
- The translated text will be displayed on the page.
app.py
: Main Flask application file containing routes and logic.templates/
: Directory containing HTML templates for rendering pages.static/
: Directory containing static files like CSS stylesheets or JavaScript scripts.requirements.txt
: File listing Python dependencies.