官术网_书友最值得收藏!

Understanding the architecture of Pictorial Translator 

Following the architecture template defined in Chapter 2, Anatomy of a Modern AI Application, here is the architectural design for Pictorial Translator:

We will provide a web user interface for users to upload photos containing foreign text and then view the translation of the foreign text. The web user interface will interact with the Orchestration Layer containing two RESTful endpoints to handle the image upload and translation:

  • Upload Image Endpoint will delegate the image upload to our Storage Service:
    •  Storage Service provides an abstraction layer to AWS S3, where the uploaded photos will be stored, processed, and displayed from.
  • Translate Image Text Endpoint will delegate the detection of text within the photos to our Recognition Service and the translation of the detected text to our Translation Service:
    • The Recognition Service provides an abstraction layer to the Amazon Rekognition service, more specifically, the text detection capability of Rekognition. We named our service Recognition, which is more generic and doesn't directly tie us in with AWS Rekognition.
    • The Translation Service provides an abstraction layer to the Amazon Translate service to perform the language translation.

The Service Implememntation might seem redundant to some readers. Why not just have the endpoints talk to the AWS services directly instead of talking through another layer of abstraction? There are many benefits to architecting the application this way. Here are a few examples:

  • During development time, we can more easily build and test the application without dependency on AWS services. Any stub or mock implementation of these services can be used during development for speed, cost, and experimentation reasons. This lets us develop and iterate the application faster.
  • When other services that provide better storage, recognition, or translation capabilities come along, our application can switch to those capabilities by swapping to a new service implementation with the same abstraction interface. The user interface and the endpoints will not need to be modified to leverage these better capabilities. This gives our application more flexibility to adapt to changes.
  • This makes our code base more composable and reusable. The capabilities provided by these AWS services can be reused by other applications. These services are modular packages that can be more easily reused than the orchestration endpoints. The orchestration endpoints usually contain application-specific business logic that limits reuse.
主站蜘蛛池模板: 阿克陶县| 阿拉善左旗| 深州市| 平江县| 杭锦后旗| 盐源县| 威宁| 扬州市| 江山市| 株洲县| 苍溪县| 闸北区| 额尔古纳市| 新郑市| 开原市| 吉林市| 台中县| 白朗县| 永泰县| 长沙县| 泌阳县| 武安市| 安岳县| 南召县| 江口县| 临夏市| 霍林郭勒市| 沈阳市| 襄樊市| 高台县| 新疆| 道孚县| 融水| 西宁市| 马鞍山市| 临泉县| 沅江市| 明星| 教育| 鄯善县| 余干县|