Pages

C3 Health Services

Visit Official Website 9278982994

Expert Healthcare at Your Doorstep

Thursday, 20 November 2025

Agile Senior Delivery Manager Job at BCG (Boston Consulting Group), Gurgaon – Job ID: 54774

Boston Consulting Group (BCG) is seeking an Agile Senior Delivery Manager to lead product delivery across squads, drive agile transformation, and ensure high‑quality releases aligned with business goals. This role focuses on end‑to‑end delivery management, agile coaching, stakeholder collaboration, and continuous improvement.

Job Id54774

Click on the above Job Id link to go to BCG website to apply.

🎯 Roles and Responsibilities

  • Product Delivery Management
    • Oversee planning, execution, and release of product increments.
    • Align initiatives, epics, and features with product roadmap.
    • Manage cross‑squad dependencies for smooth delivery.
  • Release Planning & Execution
    • Collaborate with Product Owners and chapter leads on release cycles.
    • Support pre‑ and post‑release activities including L2 support.
    • Enable faster deployments and frequent customer feedback loops.
  • Risk & Issue Management
    • Identify delivery risks and mitigate proactively.
    • Escalate impediments to stakeholders when necessary.
  • Metrics & Reporting
    • Track velocity, lead time, cycle time, and predictability.
    • Build dashboards and reports for leadership visibility.
    • Use data insights to improve squad performance.
  • Agile Coaching & Enablement
    • Guide teams in Scrum, Kanban, or hybrid agile frameworks.
    • Ensure agile ceremonies are effective and outcome‑driven.
    • Foster innovation, experimentation, and psychological safety.
  • Stakeholder Collaboration
  • Partner with Product Owners to align delivery with vision and OKRs.
  • Manage stakeholder expectations and backlog prioritization.

🎓 Certifications & Qualifications Required

  • Preferred Certifications:
    • PSM II (Scrum.org)
    • CSM (Scrum Alliance)
    • SAFe RTE / SAFe Scrum Master / SAFe Advanced Scrum Master
    • Agile Delivery Management
  • Education:
    • Bachelor’s degree in Computer Science, IT, or related field preferred.
  • Experience:
    • 10+ years in Agile roles (Scrum Lead, Agile Coach, Delivery Manager).
    • Strong expertise in SAFe, XP, DevOps, and enterprise IT projects.
    • Hands‑on with JIRA, Confluence, and agile program management tools.
    • Knowledge of OKRs and Generative AI is a plus.

👥 Who You’ll Work With

    • Product Owners and squads to achieve business outcomes.
    • Other Scrum Leads to share best practices and align culture.
    • Portfolio Agile Coaches to promote organizational agility.
    • Product Leaders, Technical Area Leads, and Chapter Leads.

💡 Key Skills & Competencies

    • Strong stakeholder management and communication skills.
    • Ability to solve complex problems in ambiguous settings.
    • Data‑driven decision making and strategic thinking.
    • Proven team coaching and leadership experience.
    • Expertise in digital transformation and enterprise delivery.

Monday, 19 June 2023

600+ AWS Objective Type Questions (12 Quizzes with 50 Questions each)

We have compiled 600 AWS objective questions across 12 test papers to help you test your understanding and expertise. 

My Tech Basket

Following topics are covered in these 12 exams.

AWS Basics:

We start our journey with the fundamentals. This section introduces AWS, its core concepts, and the benefits it offers. Gain insights into the AWS Global Infrastructure, AWS Management Console, and key AWS services. Understand how AWS can help you build scalable and reliable applications in the cloud.

Compute Services in AWS:

Discover the power of compute services in AWS. Explore Amazon Elastic Compute Cloud (EC2), Amazon Elastic Container Service (ECS), and AWS Lambda. Learn how to provision virtual servers, containers, and serverless functions to meet your application's computational needs.

Storage and Database Services in AWS:

Data is the lifeblood of any application. Dive into AWS storage services such as Amazon Simple Storage Service (S3), Amazon Elastic Block Store (EBS), and Amazon Relational Database Service (RDS). Uncover the capabilities of each service and explore options for data storage, backup, and retrieval.

Networking and Content Delivery in AWS:

Connectivity and content delivery are crucial aspects of any cloud infrastructure. Discover AWS networking services, including Amazon Virtual Private Cloud (VPC), Amazon Route 53, and Amazon CloudFront. Learn how to create secure and scalable network architectures to ensure optimal performance for your applications.

Security and Identity Services in AWS:

Security is of paramount importance in the cloud. Explore AWS Identity and Access Management (IAM), AWS Key Management Service (KMS), and AWS Certificate Manager (ACM). Understand how these services can help you secure your AWS resources, manage access permissions, and encrypt sensitive data.

Management and Monitoring Services in AWS:

Efficiently managing and monitoring your AWS environment is essential for smooth operations. Learn about AWS CloudFormation, AWS CloudTrail, and Amazon CloudWatch. Discover how these services enable you to automate resource provisioning, track API activity, and monitor system metrics.

Analytics and Big Data Services in AWS:

Harness the power of data analytics and big data processing with AWS. Dive into services such as Amazon Redshift, Amazon Athena, and AWS Glue. Gain insights into data warehousing, data lakes, and analytics workflows in the AWS ecosystem.

AI and Machine Learning Services in AWS:

Explore the cutting-edge world of artificial intelligence and machine learning on AWS. Discover services like Amazon Rekognition, Amazon SageMaker, and Amazon Comprehend. Learn how to leverage these services to build intelligent applications and extract valuable insights from data.

Serverless Computing in AWS:

Serverless computing offers a paradigm shift in application development. Explore AWS Lambda, Amazon API Gateway, and AWS Step Functions. Understand the benefits of serverless architecture and learn how to build scalable and cost-effective serverless applications.

DevOps and CI/CD in AWS:

Accelerate your software delivery pipeline with AWS DevOps services. Dive into AWS CodePipeline, AWS CodeCommit, and AWS CodeDeploy. Learn how to automate application deployment, implement continuous integration and continuous deployment (CI/CD), and foster collaboration within development teams.

AWS Scenario-Based Mixed Questions - Part 1:

Test your knowledge with scenario-based questions that simulate real-world AWS scenarios. Explore various AWS services and their application in practical use cases. Challenge yourself and enhance your problem-solving skills.

AWS Scenario-Based Mixed Questions - Part 2:

Continue the journey of scenario-based questions in this second part. Encounter new challenges and expand your understanding of AWS by solving complex scenarios. Strengthen your ability to architect solutions and make informed decisions.

Remember, practice and hands-on experience are key to mastering AWS. Use the 600 objective questions provided to assess your knowledge and identify areas for further exploration. Start your AWS journey today and unlock the full potential of cloud computing!

Visit My Tech Basket for more AWS resources, tutorials, and additional study material.

Thursday, 15 June 2023

30 Must-Know TensorFlow Interview Questions and Answers

Prepare for interviews by understanding the fundamental concepts, practicing coding, and exploring real-world use cases of TensorFlow. These TensorFlow interview questions and answers should serve as a starting point to help you in your preparation.

1. What is TensorFlow?

TensorFlow is an open-source machine learning framework developed by Google that is widely used for building and training machine learning models.

2. What are the key features of TensorFlow?

Some key features of TensorFlow include its flexibility, scalability, support for distributed computing, automatic differentiation, and support for both CPU and GPU computations.

3. What is a TensorFlow graph?

A TensorFlow graph is a computational graph that represents the flow of data and operations in a TensorFlow model. It consists of nodes (representing operations) and edges (representing data tensors).

4. What are tensors in TensorFlow?

Tensors are multi-dimensional arrays used to represent data in TensorFlow. They can be scalars (0-dimensional), vectors (1-dimensional), matrices (2-dimensional), or higher-dimensional arrays.

5. What is the difference between TensorFlow 1.x and TensorFlow 2.x?

TensorFlow 2.x introduced several improvements and simplifications compared to TensorFlow 1.x, including eager execution by default, a more intuitive API, and improved support for customization and deployment.

6. How can you define a model in TensorFlow?

In TensorFlow, you can define a model by creating a computational graph using TensorFlow's high-level APIs like Keras or by building the graph manually using lower-level TensorFlow operations.

7. Explain the concept of eager execution in TensorFlow.

Eager execution is a mode in TensorFlow 2.x that allows you to execute operations immediately as they are called, rather than building a computational graph first. It makes TensorFlow code more intuitive and easier to debug.

8. What is the purpose of placeholders in TensorFlow?

Placeholders are used to feed data into a TensorFlow model during training or inference. They are typically used for inputs that may vary in size or value during different training or inference steps.

9. How can you save and restore TensorFlow models?

TensorFlow provides the tf.train.Saver class that allows you to save and restore model variables. You can save the entire model or specific variables to disk and later restore them to continue training or perform inference.

10. Explain the concept of checkpoints in TensorFlow.

Checkpoints are files that store the values of all variables in a TensorFlow model at a specific point in training. They can be used to save and restore model states, track training progress, and resume training from a specific checkpoint.

11. What is TensorFlow Lite?

TensorFlow Lite is a lightweight version of TensorFlow designed for mobile and embedded devices. It enables the deployment of TensorFlow models on resource-constrained platforms.

12. How can you optimize TensorFlow models for better performance?

TensorFlow provides various techniques for optimizing models, including quantization, pruning, model compression, and hardware-specific optimizations like using GPU or TPU accelerators.

13. What is transfer learning in TensorFlow?

Transfer learning is a technique in which pre-trained models are used as a starting point for training a new model on a different but related task. It allows leveraging knowledge learned from large datasets and models.

14. How can you deploy TensorFlow models in production?

TensorFlow models can be deployed in production using various methods, such as serving the model through TensorFlow Serving, converting the model to a TensorFlow.js format for web deployment, or deploying on cloud platforms like TensorFlow Extended (TFX) or TensorFlow on AWS.

15. What are some common activation functions in TensorFlow?

Some common activation functions in TensorFlow include sigmoid, tanh, ReLU (Rectified Linear Unit), softmax, and Leaky ReLU.

16. What is the purpose of optimizers in TensorFlow?

Optimizers in TensorFlow are used to minimize the loss function and update the model's parameters during training. They apply various optimization algorithms like Stochastic Gradient Descent (SGD), Adam, RMSProp, etc.

17. How can you visualize TensorFlow graphs?

TensorFlow provides tools like TensorBoard for visualizing TensorFlow graphs. You can add summary operations to your graph and use TensorBoard to visualize metrics, graph structures, and other useful information.

18. Explain the concept of data pipelines in TensorFlow.

Data pipelines in TensorFlow are used to efficiently load and preprocess large datasets for training or inference. TensorFlow provides APIs like tf.data to build efficient data input pipelines.

19. What is distributed TensorFlow?

Distributed TensorFlow enables the training and inference of TensorFlow models on multiple devices or machines. It allows parallel processing, scaling, and efficient utilization of resources.

20. What are some popular TensorFlow-based projects or libraries?

Some popular TensorFlow-based projects or libraries include TensorFlow Hub, TensorFlow Extended (TFX), TensorFlow.js, TensorFlow Serving, and TensorFlow Lite.

21. What is eager execution in TensorFlow 2.x?

Eager execution is a mode in TensorFlow 2.x that enables immediate execution of operations. It eliminates the need for explicit session management and allows for dynamic control flow and easy debugging.

22. How can you handle overfitting in TensorFlow?

To handle overfitting in TensorFlow, you can use techniques like regularization (e.g., L1 or L2 regularization), dropout, early stopping, and data augmentation. These techniques help prevent the model from memorizing the training data and improve generalization.

23. What are TensorFlow Estimators?

TensorFlow Estimators are a high-level API that simplifies the process of model development, training, and evaluation. They provide pre-built models and encapsulate the training loop, making it easier to create production-ready models.

24. What is the purpose of TensorBoard in TensorFlow?

TensorBoard is a web-based visualization tool provided by TensorFlow. It allows you to track and visualize various aspects of your model's performance, such as loss, accuracy, and computation graphs, making it easier to analyze and debug your models.

25. How can you save and load only the model weights in TensorFlow?

You can save and load only the model weights in TensorFlow using the tf.keras.Model.save_weights() and tf.keras.Model.load_weights() methods. This is useful when you want to reuse the model architecture but load different weights.

26. What is the difference between TensorFlow and PyTorch?

TensorFlow and PyTorch are both popular deep learning frameworks. While TensorFlow has a stronger focus on production deployment, distributed computing, and mobile deployment, PyTorch is known for its dynamic computation graph, simplicity, and strong research community.

27. How can you handle imbalanced datasets in TensorFlow?

To handle imbalanced datasets in TensorFlow, you can use techniques like oversampling the minority class, undersampling the majority class, or using advanced algorithms like SMOTE (Synthetic Minority Over-sampling Technique) to generate synthetic samples.

28. What is the purpose of the TensorFlow Extended (TFX) library?

TensorFlow Extended (TFX) is an end-to-end platform for deploying production machine learning pipelines. It provides tools and components for data validation, preprocessing, model training, model analysis, and serving.

29. How can you use TensorFlow for natural language processing (NLP) tasks?

TensorFlow provides various tools and APIs for NLP tasks, such as the TensorFlow Text library, which offers a collection of text-related operations and models. Additionally, pre-trained models like BERT and GPT-2 can be fine-tuned for specific NLP tasks using TensorFlow.

30. What are TensorFlow's eager execution advantages over graph execution?

Eager execution in TensorFlow offers advantages like improved flexibility, easier debugging, more intuitive code, support for dynamic control flow, and the ability to use Python's debugging tools seamlessly.

These are sample questions, and the actual questions you may encounter in an interview can vary. It's important to have a solid understanding of TensorFlow concepts, programming, and practical implementation to perform well in a TensorFlow interview.

Friday, 2 June 2023

How to send emails to your users from your website using Brevo (SendInBlue) API in PHP?

Below PHP code demonstrates how to send emails from your website using Brevo (SendInBlue) API in PHP. You should have API key handy before using this code. Please put entire code in try catch block.

//Set endpoint and api key

$endpoint = 'https://api.brevo.com/v3/smtp/email';

$api_key = 'YOUR_API_KEY';

//Request payload

$data = array(

    'sender' => array(

        'name' => 'Sender Alex',

        'email' => 'senderalex@example.com'

    ),

    'to' => array(

        array(

            'email' => 'testmail@example.com',

            'name' => 'John Doe'

        )

    ),

    'subject' => 'Hello world',

    'htmlContent' => '<html><head></head><body><p>Hello,</p><p>This is my first transactional email sent from Brevo.</p></body></html>'

);

//Set cURL options

$options = array(

    CURLOPT_URL => $endpoint,

    CURLOPT_POST => true,

    CURLOPT_POSTFIELDS => json_encode($data),

    CURLOPT_RETURNTRANSFER => true,

    CURLOPT_HTTPHEADER => array(

        'accept: application/json',

        'api-key: ' . $api_key,

        'content-type: application/json'

    )

);

//Initialize cURL session

$curl = curl_init();

//Set cURL options

curl_setopt_array($curl, $options);

//Execute the request

$response = curl_exec($curl);

//Check for errors

if ($response === false) {

    echo 'Error: ' . curl_error($curl);

} else {

    //Process the response

    $response_data = json_decode($response, true);

    if (isset($response_data['message'])) {

        echo 'Email sent successfully!';

    } else {

        echo 'Email sending failed. Error: ' . $response_data['error'];

    }

}

//Close cURL session

curl_close($curl);

PayPal vs. Stripe: Choosing the Best Payment Platform for International Payments

PayPal and Stripe are two leading payment platforms that cater to businesses seeking to accept payments internationally through their websites. While both platforms offer similar core functionality, there are some notable differences worth considering.

PayPal:

Trusted and Recognized: PayPal is one of the most widely recognized and trusted payment platforms globally. It has been around for a long time, and many users are familiar with the PayPal brand.

User-Friendly Setup: PayPal offers a user-friendly setup process, allowing businesses to quickly create an account, link their bank account or credit card, and start accepting payments.

Multiple Payment Options: PayPal supports various payment methods, including credit cards, debit cards, PayPal accounts, and digital wallets. This flexibility allows customers to choose their preferred payment method during checkout.

International Transactions: PayPal supports transactions in multiple currencies, making it suitable for businesses operating globally. It also handles currency conversion automatically, simplifying cross-border transactions.

Buyer and Seller Protection: PayPal provides built-in buyer and seller protection programs. This helps protect both parties in case of disputes, chargebacks, or fraudulent transactions, providing an additional layer of security.

Stripe:

Developer-Friendly Integration: Stripe is known for its developer-friendly APIs and extensive documentation, making it easier for businesses to integrate and customize payment solutions according to their specific needs.

Seamless Checkout Experience: Stripe offers a highly customizable and optimized checkout experience. It allows businesses to design and control the entire payment flow on their website, creating a seamless and branded user experience.

Advanced Payment Features: Stripe provides a comprehensive set of payment features beyond standard payment processing. It supports subscriptions, recurring billing, complex payment flows, and offers more advanced features for businesses with specific requirements.

Global Payment Support: Stripe supports payments in over 135 currencies and provides localized payment methods, such as Alipay and WeChat Pay, making it suitable for businesses targeting international customers.

Advanced Fraud Prevention: Stripe incorporates advanced fraud detection mechanisms, machine learning algorithms, and provides tools to help businesses mitigate fraudulent transactions. It offers customizable fraud rules and real-time risk evaluation.

When choosing between PayPal and Stripe, it is important to consider your specific business requirements. Evaluate factors such as ease of integration, customization options, target audience, transaction volume, and desired payment features. Additionally, compare transaction fees, pricing structures, and available customer support to make an informed decision that aligns with your business goals and preferences. 

20 Commonly Asked Data Science Interview Questions and Answers

Here are 20 commonly asked data science interview questions and answers.

1. What is the role of a data scientist in a business setting?

A data scientist helps businesses make data-driven decisions by analyzing large volumes of data, building predictive models, identifying patterns and trends, and providing insights to solve complex problems.

2. How do you handle missing data in a dataset?

Missing data can be handled by various methods such as removing rows with missing values, imputing missing values using statistical measures like mean or median, or using advanced techniques like multiple imputation or predictive models.

3. What is the difference between univariate, bivariate, and multivariate analysis?

Univariate analysis involves analyzing a single variable, bivariate analysis involves analyzing the relationship between two variables, and multivariate analysis involves analyzing the relationship between three or more variables.

4. How do you assess the quality of a data visualization?

The quality of a data visualization can be assessed based on factors such as clarity, accuracy, relevance to the audience, effective use of visual elements, and the ability to convey insights or patterns in the data.

5. What are some common techniques for feature selection in data science?

Common techniques for feature selection include filter methods (such as correlation and information gain), wrapper methods (such as forward/backward selection and recursive feature elimination), and embedded methods (such as LASSO and Ridge regression).

6. Explain the concept of outlier detection and its importance in data analysis.

Outlier detection involves identifying observations that significantly deviate from the normal behavior of the data. Outliers can impact the statistical analysis and model performance, so detecting and handling them appropriately is crucial for accurate insights.

7. How do you handle imbalanced datasets in classification problems?

Imbalanced datasets, where one class is significantly more prevalent than others, can be addressed by techniques such as oversampling the minority class, undersampling the majority class, or using advanced algorithms like SMOTE (Synthetic Minority Over-sampling Technique).

8. What are some common techniques for dimensionality reduction in data science?

Common techniques for dimensionality reduction include Principal Component Analysis (PCA), Linear Discriminant Analysis (LDA), t-SNE (t-Distributed Stochastic Neighbor Embedding), and autoencoders.

9. Explain the concept of time series analysis and its applications.

Time series analysis involves studying and modeling data collected over time to uncover patterns, trends, and seasonality. It finds applications in forecasting, anomaly detection, economic analysis, stock market analysis, and many other fields.

10. How do you handle multicollinearity in regression analysis?

Multicollinearity occurs when two or more predictor variables in a regression model are highly correlated. It can be handled by techniques such as removing one of the correlated variables, performing dimensionality reduction, or using regularization techniques like Ridge regression.

11. What is the role of hypothesis testing in data science?

Hypothesis testing is used to make inferences about a population based on a sample of data. It helps data scientists determine if there is enough evidence to support or reject a specific hypothesis or claim about the data.

12. Explain the concept of feature extraction in data science.

Feature extraction involves transforming raw data into a reduced set of meaningful and informative features. It aims to capture the most relevant aspects of the data, reduce dimensionality, and improve the performance of machine learning models.

13. How would you approach a data science project from start to finish?

The approach to a data science project typically involves understanding the problem, gathering and exploring the data, preprocessing and cleaning the data, performing exploratory data analysis, building and evaluating models, and communicating the findings or insights.

14. What are some common data preprocessing techniques in data science?

Common data preprocessing techniques include handling missing values, dealing with outliers, scaling or normalizing features, encoding categorical variables, and splitting the data into training and testing sets.

15. What is the purpose of feature scaling in data science?

Feature scaling is used to standardize or normalize the range of features in a dataset. It ensures that features with different scales or units have a similar impact on the models and prevents one feature from dominating others during the learning process.

16. Explain the concept of cross-validation in data science.

Cross-validation is a technique used to assess the performance and generalization of a model. It involves splitting the data into multiple subsets, training the model on one subset, and evaluating it on the remaining subsets. This helps estimate the model's performance on unseen data.

17. How do you handle outliers in data analysis?

Outliers can be handled by removing them if they are due to data entry errors or by applying statistical methods such as Winsorization or trimming to replace extreme values with more reasonable values. Outliers can also be analyzed separately or treated as a separate group in certain cases.

18. What is the purpose of dimensionality reduction in data science?

Dimensionality reduction techniques aim to reduce the number of features or variables in a dataset while preserving the most important information. It helps overcome the curse of dimensionality, simplifies data analysis, improves model performance, and reduces computational complexity.

19. How do you evaluate the performance of a clustering algorithm in data science?

The performance of clustering algorithms can be evaluated using metrics such as silhouette score, cohesion, separation, or visual inspection of cluster quality. Additionally, domain-specific knowledge and interpretability of the clustering results are important considerations.

20. What is the role of data visualization in data science?

Data visualization is a critical aspect of data science as it helps in understanding the patterns, trends, and relationships present in the data. It allows for effective communication of insights, supports decision-making, and aids in identifying anomalies or outliers.

I have given very short answers. Please study and understand these concepts thoroughly to effectively answer data science interview questions. Good luck!

Wednesday, 31 May 2023

How is Machine Learning transforming and revolutionizing the automobile sector?

Machine learning is revolutionizing the automobile sector in various ways. Machine learning is driving innovation and transformation in the automobile industry, paving the way for safer, more efficient, and sustainable transportation. As technology continues to advance, the integration of machine learning in vehicles will further accelerate, shaping the future of mobility.

Here are some ways in which machine learning is transforming the automobile industry:

1. Autonomous Driving: Machine learning algorithms are a key component of self-driving cars. These algorithms analyze sensor data from cameras, LiDAR, radar, and other sources to perceive the surrounding environment, detect objects, and make real-time decisions for safe navigation. Machine learning enables autonomous vehicles to learn from data and improve their driving capabilities over time.

2. Advanced Driver Assistance Systems (ADAS): Machine learning is used in ADAS to enhance driver safety and convenience. Algorithms can detect lane departures, recognize traffic signs and signals, predict potential collisions, and assist with features like adaptive cruise control, automatic emergency braking, and blind-spot detection.

3. Predictive Maintenance: Machine learning algorithms analyze vehicle sensor data to predict maintenance needs and prevent breakdowns. By monitoring various parameters such as engine performance, tire wear, and battery health, machine learning models can identify patterns and anomalies, enabling proactive maintenance scheduling and reducing vehicle downtime.

4. Vehicle Diagnostics and Prognostics: Machine learning techniques are employed to diagnose and predict vehicle faults and failures. Algorithms can analyze data from onboard sensors and historical maintenance records to identify potential issues, recommend repairs, and optimize vehicle performance.

5. Customer Experience and Personalization: Machine learning enables automakers to provide personalized experiences to customers. By analyzing customer data, including preferences, driving behavior, and usage patterns, machine learning models can customize in-car features, infotainment systems, and assist with navigation, making the driving experience more enjoyable and tailored to individual needs.

6. Traffic Prediction and Optimization: Machine learning algorithms can analyze historical traffic data, real-time information, and weather conditions to predict traffic patterns and congestion. This information can be used to optimize routes, improve navigation systems, and enable smarter traffic management for efficient and eco-friendly transportation.

7. Vehicle Insurance and Risk Assessment: Machine learning models are used by insurance companies to assess risk factors and determine insurance premiums. By analyzing driver behavior data, including speed, acceleration, and braking patterns, machine learning algorithms can provide accurate risk assessments and enable usage-based insurance policies.

8. Supply Chain and Logistics: Machine learning is applied in supply chain management and logistics to optimize inventory management, route planning, and demand forecasting. Algorithms can analyze historical data, market trends, and customer behavior to optimize logistics operations, reduce costs, and improve delivery efficiency.

9. Manufacturing and Quality Control: Machine learning is used in automotive manufacturing for quality control and defect detection. Algorithms can analyze sensor data, images, and production parameters to identify anomalies, detect defects, and improve manufacturing processes, ensuring high-quality vehicles.

10.  Energy Efficiency and Sustainability: Machine learning algorithms can optimize vehicle energy consumption by analyzing driving patterns, road conditions, and battery performance. This helps in improving fuel efficiency, range optimization for electric vehicles, and reducing environmental impact.

11. Voice Recognition and Natural Language Processing: Machine learning algorithms enable voice recognition systems in cars, allowing drivers to interact with their vehicles through voice commands. Natural language processing techniques understand and respond to spoken instructions, enabling hands-free operation and enhancing the overall user experience.

12. Smart Predictive Navigation: Machine learning algorithms can learn from historical data and user preferences to provide smart predictive navigation. By analyzing factors such as time of day, traffic conditions, and personal habits, the navigation system can offer real-time route suggestions, optimize travel times, and provide personalized recommendations for stops along the way.

13. Gesture Recognition: Machine learning enables gesture recognition systems in vehicles, allowing drivers to control various functions with hand gestures. This hands-free interaction enhances safety and convenience, as drivers can adjust settings, answer calls, or control infotainment systems without taking their hands off the steering wheel.

14. Fleet Management and Optimization: Machine learning algorithms assist in fleet management by optimizing routes, managing vehicle assignments, and predicting maintenance needs. Fleet operators can utilize machine learning models to improve operational efficiency, reduce fuel consumption, and enhance overall fleet performance.

15. Smart Parking Solutions: Machine learning is applied to develop smart parking systems that use sensor data and historical patterns to predict parking availability. Drivers can access real-time parking information, locate available spaces, and minimize the time spent searching for parking, reducing traffic congestion and emissions.

16. Cybersecurity and Threat Detection: Machine learning techniques are used to enhance automotive cybersecurity. Algorithms can detect and mitigate potential cyber threats, such as unauthorized access or malware attacks, safeguarding vehicle systems and protecting sensitive data.

17. Vehicle-to-Vehicle Communication: Machine learning facilitates vehicle-to-vehicle (V2V) communication, enabling cars to share real-time data with each other. This data exchange allows vehicles to coordinate movements, share traffic information, and improve safety by detecting potential collision risks.

18. Energy Harvesting and Efficiency: Machine learning algorithms can optimize energy harvesting in electric vehicles by analyzing factors such as driving patterns, terrain, and energy consumption. This enables efficient energy regeneration, improved battery management, and extended range for electric vehicles.

19. Emotion Recognition and Driver Monitoring: Machine learning models can analyze driver behavior and facial expressions to recognize emotions and monitor driver attention and fatigue levels. This technology can help detect drowsiness, distraction, or aggressive driving, promoting safer driving practices and reducing accidents.

20. Connected Car Analytics: Machine learning is utilized to analyze the vast amount of data generated by connected cars. These insights can be leveraged for personalized marketing, vehicle performance monitoring, predictive maintenance, and the development of new services and features tailored to customer needs.

Machine learning continues to push the boundaries of innovation in the automobile industry, transforming the way vehicles are designed, manufactured, operated, and experienced. With ongoing advancements, we can expect further improvements in safety, efficiency, connectivity, and sustainability in the automotive sector.

Tuesday, 30 May 2023

How is Machine Learning transforming and revolutionizing the healthcare sector?

Machine learning is having a transformative impact on the healthcare sector. Machine learning is revolutionizing healthcare by enhancing diagnosis accuracy, personalizing treatments, improving patient outcomes, and optimizing healthcare delivery. As the field continues to advance, the potential for machine learning in healthcare is vast, paving the way for more efficient, precise, and patient-centered care.

Here are some ways in which machine learning is changing healthcare.

1. Disease Diagnosis: Machine learning algorithms can analyze medical images such as X-rays, CT scans, and MRIs to assist in disease diagnosis. They can detect patterns and anomalies that may not be easily identifiable by human experts, leading to more accurate and timely diagnoses.

2. Personalized Treatment: Machine learning models can analyze patient data, including medical records, genetic information, and lifestyle factors, to personalize treatment plans. This enables healthcare providers to deliver targeted interventions and optimize treatment outcomes for individual patients.

3. Predictive Analytics: Machine learning algorithms can analyze large datasets and identify patterns to predict disease progression, readmission rates, and adverse events. This helps healthcare providers intervene early, prevent complications, and improve patient outcomes.

4. Drug Discovery and Development: Machine learning is being used to accelerate the drug discovery and development process. By analyzing vast amounts of biological and chemical data, machine learning models can identify potential drug candidates, predict their efficacy, and optimize drug design.

5. Precision Medicine: Machine learning enables the identification of patient subgroups with similar characteristics, leading to more precise and targeted treatments. It can also help predict how individual patients will respond to specific therapies, allowing for personalized medicine approaches.

6. Remote Monitoring and Telemedicine: Machine learning algorithms can analyze patient data collected from wearables, sensors, and mobile devices to monitor health remotely. This enables the early detection of abnormalities, facilitates remote consultations, and improves access to healthcare in remote areas.

7. Electronic Health Records (EHR) Management: Machine learning can automate the processing and analysis of electronic health records. It helps healthcare providers extract valuable insights, improve documentation accuracy, and streamline administrative tasks, leading to more efficient healthcare workflows.

8. Fraud Detection and Healthcare Billing: Machine learning algorithms can analyze healthcare data to detect fraudulent activities, such as insurance fraud or improper billing practices. This helps reduce financial losses and ensures accurate billing and reimbursement processes.

9. Virtual Assistants and Chatbots: Machine learning powers virtual assistants and chatbots that can interact with patients, answer their queries, and provide basic medical guidance. They enhance patient engagement, provide on-demand support, and assist in triaging healthcare needs.

10. Health Monitoring and Early Warning Systems: Machine learning algorithms can analyze real-time patient data to detect early warning signs of deteriorating health. This helps healthcare providers intervene promptly, prevent emergencies, and improve patient safety.

11. Medical Imaging Analysis: Machine learning algorithms are increasingly being used to analyze medical images such as mammograms, ultrasounds, and pathology slides. These algorithms can assist radiologists in detecting abnormalities, identifying specific types of cancer, and reducing false positives and false negatives.

12. Clinical Decision Support Systems: Machine learning models can provide decision support to healthcare professionals by analyzing patient data, medical literature, and treatment guidelines. These systems can suggest optimal treatment options, predict patient outcomes, and provide evidence-based recommendations to assist clinicians in making informed decisions.

13. Predictive Risk Modeling: Machine learning algorithms can identify patients at high risk of developing specific conditions or complications. By analyzing various data sources, such as electronic health records, genetic information, and lifestyle factors, these models can predict the likelihood of diseases such as diabetes, cardiovascular diseases, or sepsis. This enables proactive interventions and preventive measures.

14. Health Monitoring Wearables: Machine learning plays a crucial role in analyzing data from wearable devices, such as fitness trackers and smartwatches. These algorithms can track vital signs, activity levels, sleep patterns, and other health-related metrics. By monitoring and analyzing this data, healthcare professionals can gain insights into a patient's overall health status, detect anomalies, and provide personalized recommendations.

15. Medical Research and Clinical Trials: Machine learning is facilitating medical research and clinical trials by enabling the analysis of large datasets and identifying potential correlations or treatment responses. It can assist in patient recruitment for clinical trials, optimize trial design, and contribute to the discovery of new biomarkers or treatment targets.

16. Health Data Management and Privacy: Machine learning techniques can help manage and secure vast amounts of health data. They can assist in data anonymization, patient de-identification, and data access controls to ensure privacy and comply with data protection regulations such as HIPAA (Health Insurance Portability and Accountability Act).

17. Disease Outbreak Prediction and Monitoring: Machine learning models can analyze various data sources, including social media, internet search trends, and sensor data, to detect early signs of disease outbreaks. By monitoring patterns and identifying geographical hotspots, public health authorities can take timely preventive measures and allocate resources effectively.

18. Chronic Disease Management: Machine learning algorithms can assist in the management of chronic diseases such as diabetes, asthma, and hypertension. By analyzing patient data, these algorithms can provide personalized recommendations, predict disease exacerbations, and support self-management efforts, leading to better patient outcomes.

19. Patient Risk Stratification: Machine learning models can assess patient risk scores by considering various factors such as medical history, demographics, and genetic data. These risk stratification algorithms can help healthcare providers prioritize interventions, allocate resources efficiently, and improve population health management.

20. Healthcare Operations Optimization: Machine learning can be applied to optimize healthcare operations, including resource allocation, bed management, and staff scheduling. By analyzing historical data, patient flow, and demand patterns, machine learning models can help hospitals and healthcare facilities streamline processes, reduce wait times, and improve efficiency.

These are just a few examples of how machine learning is transforming the healthcare sector. With the increasing availability of healthcare data and advancements in machine learning techniques, the potential for improving patient care, enhancing diagnostics, and revolutionizing healthcare delivery is immense. 

Thursday, 29 April 2021

100 basic terms and comparisons from PMBOK which a PMP certified project manager must know

A PMP Certified Project Manager should be knowing following comparisons. These comparisons can be asked in a project management interview for PMP certified project managers. I have divided all these terms and comparisons based upon the knowledge areas.

General Introduction

1) Project vs Operation

2) Product Life Cycle vs Project Life Cycle

3) Project Phase vs Phase Gate

4) Development Approach: Predictive vs Adaptive vs Hybrid vs Iterative vs Incremental

5) Portfolio Management vs Program Management vs Project Management

6) Organizational Structure Type: Strong Matrix vs Weak Matrix vs Balanced Matrix

7) Types of PMO: Supportive vs Controlling vs Directive

8) Powers of Project Manager: Referent vs Positional vs Situational vs Coercive vs Ingratiating vs Persuasive

9) Leadership Styles: Laissez-faire vs Servant Leader vs Transactional vs Transformational vs Charismatic vs Interactional 

10) Project Manager vs Project Coordinator vs Project Expeditor

11) PMI Triangle: Technical Project Management vs Strategic and Business Management vs Leadership

12) Code of Ethics and Professional Conduct: Aspirational Standards and Mandatory Standards

Integration Management

13) OPA (Organizational Process Assets) vs EEF (Enterprise Environmental Factors)

14) Business Case vs Benefits Management Plan

15) Configuration Management Plan vs Change Management Plan

16) Project Charter vs Team Charter

17) Assumption log: Assumptions vs Constraints

18) Change Requests: Preventive actions vs Corrective actions vs Defect repair

19) Knowledge Management vs Information Management

20) Explicit Knowledge vs Tacit Knowledge

21) Work/Job Shadowing vs Reverse Shadowing

22) Work Performance Data vs Work Performance Information vs Work Performance Report

23) Work Performance Reports: Status report vs Progress report

24) Payback Period vs Return on Investment (ROI) vs Internal Rate of Return (IRR) vs Discounted Cash Flow vs Net Present Value (NPV) vs Benefit Cost Ratio (BCR)

Scope Management

25) Project Charter vs Project Scope Statement

26) WBS: Work Package vs Planning Package

27) WBS: Work Package vs Activities

28) Scope Baseline vs Schedule Baseline vs Cost Baseline vs Performance Measurement Baseline

29) Validate Scope Process vs Control Quality Process

30) Scope Creep and Gold Plating

31) Product Scope vs Project Scope

32) Inspection vs Audit

33) Verification vs Validation

34) Work Breakdown Structure vs Resource Breakdown Structure vs Risk Breakdown Structure vs Organizational Breakdown Structure

35) Brainstorming vs Brain-writing vs Nominal Group Technique

36) Decision Making: Autocratic vs Multi-criteria vs Voting (Unanimity vs Majority vs Plurality)

Schedule Management

37) Iterative Scheduling vs On-demand Scheduling

38) Precedence Diagramming Method vs Arrow Diagramming Method

39) Finish to Start (FS) vs Finish to Finish (FF) vs Start to Start (SS) vs Start to Finish (SF)

40) Dependencies: Mandatory vs Discretionary vs External vs Internal

41) Schedule Network Diagram: Path Convergence vs Path Divergence

42) Critical Path Method vs Critical Chain Method

43) Early Start vs Early Finish vs Late Start vs Late Finish

44) Forward Pass vs Backward Pass

45) Leads vs Lags

46) Total Float vs Free Float

47) Project Schedule: Gantt charts vs Bar charts vs Milestone charts vs Summary charts

48) Fast-tracking vs Crashing

49) Resource Optimization vs Resource Levelling

50) Project Calendar vs Resource Calendar

51) Contingency Reserve (Known Unknown) vs Management Reserve (Unknown Unknown)

52) Triangular Distribution vs PERT/Beta Distribution

53) Analogous Estimating vs Parametric Estimating vs Three-point Estimating vs Bottom-up Estimating

54) Accuracy and Precision

55) Activity List vs Milestone List

56) Student Syndrome vs Parkinson's Law

Cost Management

57) Rough Order of Magnitude Estimate (-25% to +75%) vs Budgeted Estimate (-10% to +25%) vs Definitive Estimate (-5% to +10%)

58) Planned Value (PV) vs Earned Value (EV) vs Actual Cost (AC)

59) Cost variance (CV = EV - AC) vs Schedule variance (SV = EV - PV)

60) Cost Performance Index (CPI = EV/AC) vs Schedule Performance Index (SPI = EV/PV)

61) Budget at Completion (BAC) vs Estimate at Completion (EAC) vs Variance at Completion (VAC = BAC - EAC)

62) EAC Calculation: EAC forecast for ETC work performed at the budgeted rate (EAC = AC + (BAC – EV)) vs EAC forecast for ETC work performed at the present CPI (EAC = BAC / CPI) vs EAC forecast for ETC work considering both SPI and CPI factors (EAC = AC + [(BAC – EV) / (CPI × SPI)]) vs To-complete performance index (TCPI = Work Remaining / Fund Remaining)

Quality Management

63) Quality vs Grade

64) Attribute Sampling vs Variable Sampling

65) Continual Improvement: Plan-do-check-act (PDCA) vs Total Quality Management(TQM) vs Six Sigma vs Lean Six Sigma

66) Cost of Conformance vs Cost of Non-conformance

67) Cost of Conformance: Prevention cost vs Appraisal cost

68) Cost of Non-Conformance: Internal Failure Cost vs External Failure Cost

69) Control Charts vs Flowcharts vs Histograms vs Cause-and-effect Diagrams vs Matrix Diagrams vs Scatter Diagrams vs Affinity Diagrams vs Mind Mapping

Resource Management

70) Matrix: Responsibility Assignment Matrix (RAM / RACI) vs Probability and Impact Matrix vs Stakeholder Engagement Assessment Matrix

71) Tuckman Ladder: Forming vs Storming vs Norming vs Performing vs Adjourning

72) Co-located Teams vs Virtual Teams

73) Conflict Management: Withdraw/Avoid vs Smooth/Accommodate vs Compromise/Reconcile (Lose-Lose) vs Force/Direct (Win-Lose) vs Collaborate/Problem Solve (Win-Win)

74) Develop Team vs Manage Team

75) Coaching vs Mentoring

Communication Management

76) Push vs Pull communication

77) Verbal vs Non-verbal communication (Paralinguistic, Vocal inflection, Pitch, Tone)

Risk Management

78) Risks vs Issues

79) Event vs Non-event Risks

80) Variability Risk vs Ambiguity Risk vs Emergent Risks (Unknowable Unknowns)

81) Secondary risk vs Residual risk

82) Risk Register vs Risk Report

83) Opportunities (Positive Risks) vs Threats (Negative Risks)

84) Strategies for Opportunities: Exploit vs Enhance vs Accept vs Share

85) Strategies for Threats: Avoid vs Mitigate vs Accept vs Transfer

86) Active Risk Acceptance vs Passive Risk Acceptance

87) Qualitative vs Quantitative Risk Analysis

88) Quantitative Risk Analysis: Simulations (Monte Carlo Analysis) vs Sensitivity Analysis (Tornado Diagrams) vs Decision Tree Analysis vs Influence Diagrams

89) Prompt Lists: PESTLE (political, economic, social, technological, legal, environmental) vs TECOP (technical, environmental, commercial, operational, political) vs VUCA (volatility, uncertainty, complexity, ambiguity)

90) Risk Assessment Parameters: Urgency vs Proximity vs Dormancy vs Propinquity vs Detectability

Procurement Management

91) Contract Types:  Fixed Price vs Cost Reimbursable vs Time and Material

92) Fixed Price Contracts: Firm Fixed Price (FFP) vs Fixed Price Incentive Fee (FPIF) vs Fixed Price with Economic Price Adjustments (FPEPA)

93) Cost-reimbursable Contracts: Cost plus fixed fee (CPFF) vs Cost plus incentive fee (CPIF) vs Cost plus award fee (CPAF)

94) Bid Documents: RFI (Request for Information) vs RFQ (Request for Quotation) vs RFP (Request for Proposal)

95) Scope Statement vs Statement of Work (SOW) vs Terms of Reference (TOR)

96) Make vs Buy Analysis

97) Selecting a Seller vs Awarding a Contract

98) Claims Administration: Claims vs Disputes vs Appeals

Stakeholder Management

99) Stakeholder Analysis: Power/Interest vs Power/Influence vs Impact/Influence

100) Engagement level of stakeholders: Unaware vs Resistant vs Neutral vs Supportive vs Leading

Wednesday, 11 September 2019

Preprocessing of raw data in NLP: Tokenization, Stemming, Lemmatization and Vectorization

NLP (Natural Language Processing) is a very interesting branch of Artificial Intelligence. Natural language is a language which we human use to communicate and interact with each other. In NLP, we are teaching computers to understand, interpret and manipulate human languages. In this article, we will focus on some of the preprocessing tasks which we perform on the raw data like Tokenization, Stemming, Lemmatization and Vectorization.

While processing a natural language which we human speak, we need to take care of following things:

1. Syntax: The sentence should be grammatically correct. The arrangement of words in a sentence should follow all the grammar rules defined by a language. 

2. Semantics: It deals with the meaning of words and their interpretation within sentences.

3. Pragmatics: Same as semantics but it also consider context in which the word is used.

Applications of NLP

Applications of NLP (Natural Language Processing) are unlimited. I have listed few of those:

1. Machine translation (like Google Translate)
2. Sentiment analysis (reviews and comments on e-commerce and social-networking sites)
3. Text classification, generation and automatic summarization

4. Automated question answering and conversational interfaces (like chatbots)
5. Personal assistants (like Alexa, Siri, Google Assistant, Cortana etc.)
6. Auto-correct grammatical mistakes (MS Word and Grammarly use NLP to check grammatical errors)
7. Spam filtering, auto-complete, auto-correct, auto-tagging, topic modelling, sentence segmentation, speech recognition, part of speech tagging, named entity recognition, duplicates detection and a lot more...

NLP Toolkit (library) in Python


There are a lot of libraries in Python for NLP but the most commonly used library is NLTK( Natural Language Toolkit). It provides very efficient modules for preprocessing and cleaning of raw data like removing punctuation, tokenizing, removing stopwords, stemming, lemmatization, vectorization, tagging, parsing, and more.

Pre-processing of raw data in NLP


Following are the basic steps which we need to perform while cleaning the raw data in NLP:

1. Remove Punctuation
2. Tokenization
3. Remove Stopwords

4. Stemming / Lemmatization
5. Vectorization

1. Remove Punctuation:
First of all, we should remove all the punctuation marks (like comma, semicolon, colon, apostrophe, quotation marks, dash, hyphen, brackets, braces, parentheses, ellipsis etc.) from the text as these carry negligible weight.


2. Tokenization: Now create a list of words used in the text. Each word is called a token. We can use regular expression to find out tokens from the sentences otherwise NLTK has efficient modules for this task.

3. Remove Stopwords: Now we need to remove all the stopwords from the token list. Stopwords are the words which occur frequently in a sentence but carry little weight (like the, for, is, and, or, been, to, this, that, but, if, in, a, as etc.).

4.1 Stemming: It is used to reduce the number of tokens just like removing stopwords. In this process, we reduce inflected words to their word stem or root. We keep only the semantic meaning of similar words.

Examples: 

1) Tokens like stemming and stemmed are converted to a token stem.

2) Tokens like working, worked, works and work are converted to a token work.

Points 1 and 2 clearly illustrate that how can we reduce the number of tokens in a token list using stemming. But wait! There is a problem. Consider following examples of stemming:

3) Tokens like meanness and meaning are converted to a token mean. Now this is wrong. Both tokens have different meanings, even then its treating both as same.

4) Tokens like goose and geese are converted to the tokens goos and gees respectively (it will just remove "e" suffix from both the tokens). Now this is again wrong. "geese" is just a plural of "goose", even then its treating both tokens as different.

Points 3 and 4 can be resolved using Lemmatization.

NLTK library has 4 stemmers:

1) Porter Stemmer
2) Snowball Stemmer
3) Lancaster Stemmer
4) Regex-based Stemmer


I mainly use Porter stemmer for stemming the tokens in my NLP code.

4.2: Lemmatization: We saw the limitation of stemming in above examples (3 and 4). We can overcome these limitations using Lemmatization. It is more powerful and sophisticated as compared to stemming and returns more accurate and meaningful words / tokens by considering the context in which the word is used in a sentence.

But the tradeoff is that, it is slower and complex as compared to the stemming.

Examples: 

1) Tokens like meanness and meaning are retained as it is instead of reducing it to mean (unlike stemming).

2) Tokens like goose and geese are converted to a token goose which is right. We should get rid of the token "geese" as it is just a plural of "goose".

I mainly use WordNet Lemmatizer present in NLTK library.

5. Vectorization: Machine Learning algorithms don't understand text. These need numeric data for matrix multiplications. Till now, we have just cleaned our tokens. So, in this process, we encode our final tokens into numbers to create feature vectors so that algorithms can understand. In other words, we will fit and transform vectorization methods to our preprocessed and cleaned data which we created till lemmatization.

Document-term matrix: Let's first understand this term before proceeding further. We use document term matrix to represent the words in the text in the form of matrix of numbers. The rows of the matrix represent the text responses to be analyzed, and the columns of the matrix represent the words / tokens from the text that are to be used in the analysis.

Types of Vectorization

There are mainly 3 types vectorization:

1) Count vectorization
2) N-grams vectorization
3) Term Frequency - Inverse Document Frequency (TF-IDF)


1) Count vectorization: It creates a document-term matrix which contains the count of each unique word / token in the text response.

2) N-grams vectorization: It creates a document-term matrix which also considers context of the word depending upon the value of N.

If N = 2, it is called bi-gram,
If N = 3, it is called tri-gram,
If N = 4, it is called four-gram and so on...

We need to be careful about value of N and choose it wisely.

Example: Consider a sentence "NLP is awesome". Count vectorization will create a column corresponding to each word in document-term matrix while N-gram will create columns like following in case of bi-gram:

"NLP is", "is awesome"

3) Term Frequency - Inverse Document Frequency (TF-IDF) - It is just like count vectorization but instead of count, it stores weightage of each word by using following  formula:








w(i, j) = weightage of a particular word "i" in a document "j"

tf(i, j) = term frequency of a word "i" in document "j" i.e. number of times the word "i" occurs in a document "j" divided by total number of words in document "j"

N = number of total documents

df(i) = number of documents containing the word "i"

So, in this way, TF-IDF considers two facts while calculating the weightage of a word or token: 

1) how frequent the word occurs in a particular document 
2) and how frequent that word occurs in other documents

Example: Consider that we have 10 text messages and one of the text messages is "NLP is awesome". No other message contains the word "NLP". Now lets calculate weightage of the word NLP.

tf(i, j) = number of times the word NLP occurs in the text message divided by the total number of words in the text message. It comes out to be (1/3) as there are three words and NLP occurs only one time.

N = 10 as there are 10 text messages. 

df(i) = number of text messages containing the word NLP which in our case is 1.

So, the final equation becomes:

Weightage of NLP = (1/3) * log(10/1)

In this way, we fill all the rows and column of document-term matrix in TF-IDF.

Thursday, 5 September 2019

Image Recognition: Text Detection (Optical Character Recognition) using Google Cloud Vision API

Google Cloud Vision API helps in label detection, face detection, logo detection, landmark detection and text detection (OCR: Optical Character Recognition). In this article, we will see how can we use Google Cloud Vision API to extract the text from the image? This is a step by step guide for text detection (OCR) using Google Cloud Vision API. Let's follow it.

I will directly start from step 5. First 4 steps are same as mentioned in my previous post on label detection using Google Cloud Vision API.

You can download my Jupyter notebook containing below code from here.
 
Step 5: Import required libraries

from googleapiclient.discovery import build
from oauth2client.client import GoogleCredentials
from base64 import b64encode

You may get import error "no module name..." if you have not already installed Google API Python client. Use following command to install it.

pip install --upgrade google-api-python-client

If you also get import error for oauth2client, you must install it using following command:

pip3 install --upgrade oauth2client

Step 6: Load credentials file

Load the credentials file (which we created in step 3 of my previous article) and create a service object using it.

CREDENTIAL_FILE = 'credentials.json'
credentials = GoogleCredentials.from_stream(CREDENTIAL_FILE)
service = build('vision', 'v1', credentials=credentials)

Step 7: Load image file (from which we need to extract the text)

I will load an image of cover page of my deep learning book and encode it so that it becomes compatible with the cloud vision API.



























IMAGE_FILE = book_cover_page.jpg'
with open(IMAGE_FILE, 'rb') as file:
    image_data = file.read()
    encoded_image_data = b64encode(image_data).decode('UTF-8')

Step 8: Create a batch request

We will create a batch request which we will send to the cloud vision API. In the batch request, we will include the above encoded image and the instruction as TEXT_DETECTION.

batch_request = [{
    'image':{'content':encoded_image_data},
    'features':[{'type':'TEXT_DETECTION'}],
}]

Step 9: Create a request

request = service.images().annotate(body={'requests':batch_request})

Step 10: Execute the request

response = request.execute()

This step will throw an error if you have not enabled billing (as mentioned in step 4 of my previous article). So, you must enable the billing in order to use Google Cloud Vision API. The charges are very reasonable. So, don't think too much and provide credit card details. For me, Google charged INR 1 and then refunded it back.

Step 11: Process the response

For error handling, include this code:

if 'error' in response:
    raise RuntimeError(response['error'])

We are interested in text annotations here. So, fetch it from the response and display the results.

labels = response['responses'][0]['textAnnotations']

extracted_text = extracted_texts[0]
print(extracted_text['description'], extracted_text['boundingPoly'])

Output:

Objective Type Questions and Answers in Deep Learning
Deep
Learning
ARTIFICIAL
INTELLIGENCE
MACHINE
LEARNING
DEEP
LEARNING
NARESH KUMAR
 {'vertices': [{'x': 42, 'y': 77}, {'x': 2365, 'y': 77}, {'x': 2365, 'y': 3523}, {'x': 42, 'y': 3523}]}

You can test the above code using different images and check the accuracy of the API.

About the Author

I have more than 10 years of experience in IT industry. Linkedin Profile

I am currently messing up with neural networks in deep learning. I am learning Python, TensorFlow and Keras.

Author: I am an author of a book on deep learning.

Quiz: I run an online quiz on machine learning and deep learning.