Method and computer program for automatically generating communication interface in artificial intelligence domain algorithm
The method and computer program use semantic annotations to automatically generate communication interfaces for AI algorithms, enabling data scientists to create customer-ready products without modifying the source text, addressing the integration challenge and reducing the need for software developers.
Patent Information
- Application Number
- CN202380036903.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2022-04-29
- Filing Date
- 2023-04-12
- Publication Date
- 2024-12-31
AI Technical Summary
Existing software tools for developing artificial intelligence algorithms do not allow for the direct integration of these algorithms into customer applications and processes, and require manual modification to add communication interfaces, which is typically the responsibility of software developers, exposing the underlying source text to customers.
A method and computer program that utilize a library of semantic annotations to automatically generate communication interfaces for artificial intelligence algorithms, embedding them into a computer program product without modifying the source text, allowing data scientists to create customer-ready products.
Enables data scientists to transform AI algorithms into customer-ready products without needing software developers, maintaining the integrity of the source text, and facilitating easy integration and customization of interfaces.
Smart Images

Figure CN119234208A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method and a computer program for generating a further computer program product based on a source text of an artificial intelligence algorithm. Background Art
[0002] Special software tools are known for developing algorithms and methods in the field of artificial intelligence. These software tools, such as "Jupyter Notebook" (see also https: / / jupyter.org / ), are suitable for supporting the iterative and exploratory work of so-called data scientists during the development of artificial intelligence algorithms. However, they are not suitable for transforming the developed algorithms and methods into products that can be delivered to customers, on the one hand because these software tools do not offer the possibility of providing technically agnostic interfaces with which the algorithms and methods can be directly integrated into customer applications and customer processes. On the other hand, the source texts of the algorithms and methods cannot be hidden from the customer.
[0003] Therefore, it is common practice to date to modify the source text of the prototype implementation in order to obtain a product that can be used by customers. Here, all source text dependencies of the mentioned software tools are first removed, and communication interfaces, such as so-called "REST" interfaces, are added to the source text, which can be used as so-called APIs (Application Programming Interfaces) to process algorithms and methods through the network. Subsequently, the algorithms and methods can be provided to customers for execution via the added communication interfaces, for example, accessed via the Internet. Customers can thus start the execution of algorithms and methods through these interfaces and use the results, but cannot view the underlying source text.
[0004] Here, creating and adding communication interfaces requires a deep understanding of the communication interfaces themselves and the resulting impacts, such as input validation over the network. Therefore, it is usually the responsibility of software developers to transform the prototype implementations made by data scientists into a customer-usable product as described. Summary of the invention
[0005] The technical problem to be solved by the present invention is to simplify the development of products with algorithms and methods in the field of artificial intelligence, which can be directly integrated into any customer applications and customer processes.
[0006] The above-mentioned technical problem is solved by the subject matter of the independent claim. Further developments and embodiments of the invention are again revealed in the features of the dependent claims.
[0007] The method according to the invention for generating a computer program product based on a source text of an artificial intelligence algorithm comprises the following method steps:
[0008] a. Provide a library of semantic annotations, which includes:
[0009] -Semantic annotation, which is used to mark source text constructs for artificial intelligence algorithms;
[0010] - a logical sequence uniquely linked to the semantic annotation for generating a communication interface and for embedding the marked source text constructs into a computer program product to be produced;
[0011] b. Providing a source text analysis component for analyzing the source text to determine whether there is a semantic annotation in the source text;
[0012] c. Providing a communication interface generator for generating at least one communication interface;
[0013] d. Analyze the source text with the help of the source text analysis component to determine whether there is a semantic annotation in the source text, and transmit the following logical sequence in the library to the communication interface generator, which is uniquely linked to the semantic annotation present in the source text;
[0014] e. reading the transmitted logical sequence uniquely linked to the semantic annotation present in the source text by the communication interface generator; and
[0015] f. Generate a communication interface based on the logical sequence read by the communication interface generator;
[0016] g. Embed the generated communication interface into the computer program product to be produced.
[0017] The method according to the invention is a computer-implemented method.
[0018] When at least one source text structure of a source text of an artificial intelligence algorithm is marked with at least one semantic annotation, at least one semantic annotation is present in the source text. Therefore, when analyzing the source text according to method step d., it is analyzed whether at least one source text structure of the source text is provided with a semantic annotation in the library. If at least one semantic annotation is present in the source text, then according to method step d., a logical sequence in the library that is uniquely linked to at least one semantic annotation present in the source text is transmitted to the communication interface generator. According to method step e., the at least one transmitted logical sequence is read by the communication interface generator, and then according to method step f., at least one communication interface is generated based on the at least one logical sequence read by the communication interface generator. Subsequently, according to method step h., the at least one generated communication interface is embedded in the computer program product to be generated. The communication interface embedded in the generated computer program product is used to call the source text structure marked with the semantic annotation, and therefore to call the artificial intelligence algorithm represented by the marked source text structure.
[0019] According to the invention, a source text provided with semantic annotations, i.e. a source text having at least one source text structure, is used as input, the source text structure is marked with at least one semantic annotation from a library of semantic annotations, and a computer program product, in particular an API product, is generated from this, in particular dynamically generated at runtime. The computer program product generated in this way comprises a communication interface for embedding an artificial intelligence algorithm of a source text including an artificial intelligence algorithm into an application or a process. The method is used when developing an application or a process for automatically generating a communication interface and for embedding an artificial intelligence algorithm called via the communication interface into the generated computer program product.
[0020] The computer program product for producing another computer program product according to the present invention comprises instructions, which, when executed by a suitable computer, cause the computer to perform the method according to the present invention. The computer for executing the computer program product according to the present invention may be a terminal device or a server. The computer program product may also be referred to as a computer program.
[0021] In the context of the present invention, "generating" may also be synonymously referred to as "creating" or "generating". Thus, the method enables the creation of a computer program product based on a source text of an artificial intelligence algorithm. A corresponding computer program product according to the present invention is similarly used to create another computer program product.
[0022] In this sense, the “other” computer program product therefore relates to a computer program product which is produced or created during the execution of the method according to the invention.
[0023] For better differentiation, in the following, a computer program product is referred to as a computer program if it is intended to be used to generate or create a (further) computer program product to be created or generated. Conversely, a computer program product generated or created by means of the computer program when executing the method according to the invention is referred to as a computer program product. A third computer program product, for example, which accesses a communication interface of the generated computer program product, is referred to as a "further" computer program product.
[0024] Here, the source text is read by a computer program according to the invention for producing a computer program product and is also executed according to one embodiment of the invention. When executing the method according to the invention, the source text remains unchanged. Code lines that are particularly related to communication interfaces are not supplemented, and no code lines are written into the source text. Instead, the semantic annotation is used as a jump marker, which can be referenced using the generated communication interface and can process the marked source text structure. At the beginning of the method, the communication interface may also not have been defined in the source text. After the method is terminated, all communication interfaces of the source text structure marked with semantic annotations in the computer program product can be provided to the user.
[0025] The computer program according to the invention comprises in particular:
[0026] - a semantically annotated library, the semantically annotated library comprising:
[0027] -Semantic annotation, which is used to mark source text constructs for artificial intelligence algorithms;
[0028] - a logical sequence uniquely linked to a semantic annotation for generating a communication interface and
[0029] for embedding the marked source text construct into a computer program product to be produced;
[0030] a source text analysis component, said source text analysis component being suitably designed to:
[0031] - used to analyze the source text to determine whether there are semantic annotations in the source text;
[0032] - for transmitting at least one logical sequence in the library to the communication interface to generate
[0033] A logical sequence that is unique to at least one semantic annotation present in the source text.
[0034] Ground link;
[0035] - a communication interface generator, which is suitably designed to:
[0036] - for reading the transmitted at least one semantic annotation link present in the source text
[0037] at least one logical sequence of connections; and
[0038] - for generating at least one communication interface based on the read logical sequence.
[0039] Furthermore, it can be appropriately constructed as,
[0040] - for embedding the generated at least one communication interface into a computer program to be generated
[0041] In product.
[0042] Preferably, according to method step f., at least one communication interface is generated as a standard programming interface (application programming interface, API for short), for example as a "REST" interface, by means of a communication interface generator, and according to method step g., this communication interface is embedded in a computer program product, which is optionally provided according to method step h. The communication interface generator is designed accordingly and appropriately.
[0043] The provided library of semantic annotations comprises at least one semantic annotation and at least one logical sequence uniquely linked to the at least one semantic annotation. In particular, the provided library of semantic annotations comprises any and any number of semantic annotations and corresponding logical sequences uniquely linked thereto. Thus, for each semantic annotation, there is a logical sequence uniquely linked thereto. In the following, for the sake of clarity, the plural is mainly used in conjunction with at least one semantic annotation and at least one logical sequence uniquely linked thereto.
[0044] Semantic annotations are predefined markers with which specific parts of the source text of an artificial intelligence algorithm are marked or can be marked afterwards, so-called source text structures, in particular specific functions and function parameters or input or output parameters or results. Correspondingly, they can also be called semantic source text annotations. A predetermined logical sequence belongs to each of these markers, which determines when and how the marked source text structure is called. Therefore, each logical sequence includes predetermined rules, which are used to generate a communication interface and are therefore used for further processing, in particular for executing the source text structure of the artificial intelligence algorithm marked with the semantic annotation, and embedding the source text structure of the artificial intelligence algorithm marked with the semantic annotation into the generated computer program product.
[0045] Semantic annotations and the logical sequences linked to them fulfill two different purposes: On the one hand, they indicate for which parts of the source text a communication interface, in particular an API, is to be generated. On the other hand, they indicate which information is to be exchanged as requests and responses via these communication interfaces. In this context, the semantic annotations hide all technical details of the communication interface to be generated: The corresponding source text markup captures only the semantic meaning of the annotated source text construct and does not allow any conclusions to be drawn about the communication interface to be generated.
[0046] According to the method, in addition to the library, there are also provided: a source text analysis component for analyzing the source text to determine whether the semantic annotation in the library exists in the source text; and a communication interface generator for generating at least one communication interface.
[0047] The source text analysis component is responsible for accessing the library. This component checks whether the source text transmitted to it has tags with semantic annotations stored in the library. To this end, the source text can first be searched for tags with semantic annotations and compared with the semantic annotations stored in the library. Here, it can also be said that the semantic annotations in the source text are obtained and the semantic annotations provided in the library are identified.
[0048] Subsequently, the logical sequences associated with the identified semantic annotations and uniquely linked thereto are transferred from the library to the communication interface generator. Subsequently, the communication interface generator generates all the required communication interfaces based on the rules of these logical sequences, and therefore according to the rules of these logical sequences. To this end, the information in the logical sequences is read and processed according to a predetermined algorithm. The logical sequences accordingly include all the specifications and parameters sufficient to generate the communication interface.
[0049] Finally, the generated communication interface is embedded in a computer program product. According to a first extension, this is done by means of a communication interface providing component. In a further extension, the generated computer program product is provided by means of a communication interface providing component so that the generated communication interface can be accessed and, via these communication interfaces, in particular via a network, the artificial intelligence algorithm can be accessed. The communication interface providing component is responsible for enabling access to the generated communication interface via a network, thus enabling access to the source text structure marked with semantic annotations.
[0050] In accordance with the aforementioned development, the method comprises:
[0051] - at least the following method steps before method step f.:
[0052] oProvide components for communication interface;
[0053] - The following additional features in method step f.:
[0054] oTransmitting the generated communication interface to the communication interface providing component;
[0055] - wherein the method step g. comprises:
[0056] g. embedding the transmitted communication interface into a computer program product through a communication interface providing component;
[0057] - After method step g.:
[0058] h. Providing the generated computer program product including the generated at least one communication interface through the communication interface providing component.
[0059] A further expanded computer program for generating a computer program product correspondingly includes a communication interface providing component, which is appropriately constructed to provide the generated computer program product through the communication interface providing component, wherein the communication interface generator is also appropriately constructed to transmit the generated computer program product to the communication interface providing component.
[0060] All communication interfaces generated by the communication interface generator are transmitted to the communication interface providing component and embedded in a computer program product, such as a Web application, so that all communication interfaces in the computer program product can be accessed by a user. Therefore, the generated communication interfaces are also provided for access by other different computer program products, such as applications or processes. The communication interface providing component is correspondingly appropriately configured to embed the transmitted communication interfaces in a computer program product and provide the computer program product.
[0061] In a further extension, the generated computer program product is a Web application. A Web application (Web application or also referred to as Web-App) is an application stored on a remote server and provided via a browser interface via the Internet. The communication interface providing component is correspondingly suitable for providing the generated computer program product via a browser interface.
[0062] Another embodiment of the method according to the invention consists in that at least before method step d.:
[0063] - marking at least one source text construct of the source text with at least one semantic annotation from the library.
[0064] Of course, this method step can especially be before method step a. Marking the source text with semantic annotations according to the library can be done manually, for example, by a data scientist. When creating the source text or afterwards, that is, after the source text is created, the selected source text structure related to the specific artificial intelligence algorithm is annotated, that is, marked with semantic annotations according to the library, thereby determining the input value to the algorithm or the output value from the algorithm through a predefined logical sequence uniquely linked to the semantic annotation. The algorithm developers, especially data scientists, know the algorithms best and how they should be called. However, the developers do not need to consider the specific design of the communication interface for calling the algorithm. This is done automatically by the computer program according to the present invention. That is to say, another advantage of the present invention is that no additional professional software developers are required to create and configure the communication interface.
[0065] In a further development, method step a. may be preceded by:
[0066] - providing a source text using an artificial intelligence algorithm, the source text comprising at least one semantic annotation of at least one source text construct of the source text;
[0067] - providing an input interface for reading a source text and for transmitting the source text to a source text analysis component;
[0068] -Transmitting the source text read through the input interface to the source text analysis component.
[0069] Correspondingly, the computer program for generating the computer program product may have an input interface which is suitably designed to:
[0070] - reading a source text for the artificial intelligence algorithm including semantic annotations for marking source text constructs of the source text for the artificial intelligence algorithm in the source text;
[0071] - The read source text is transmitted to the source text analysis component.
[0072] According to another development, the library of semantic annotations provided according to method step a. further comprises at least one configuration template, which is uniquely linked to at least one logical sequence and comprises definitions of configuration parameters for modifying at least configuration parameters of the logical sequence, wherein method step d. comprises:
[0073] d. Analyze the source text with the help of the source text analysis component to determine whether there is a semantic annotation in the source text, and transmit the logical sequence in the library that is uniquely linked to the semantic annotation present in the source text, and transmit the configuration template in the library that is uniquely linked to the transmitted logical sequence to the communication interface generator;
[0074] And wherein the method step e. comprises:
[0075] e. reading the transmitted logical sequence uniquely linked to the semantic annotation present in the source text by the communication interface generator, and reading the transmitted configuration template uniquely linked to the transmitted logical sequence by the communication interface generator;
[0076] Therein, after method step e. and before method step f.:
[0077] ee. Generate a configuration interface with the help of a communication interface generator based on the read logic sequence and based on the read configuration template uniquely linked to the read logic sequence, and provide the generated configuration interface for modifying at least the configuration parameters of the logic sequence.
[0078] With the aid of a communication interface generator, based on at least one logical sequence read and based on at least one configuration template read, at least one configuration interface for configuring configuration parameters of at least one logical sequence transmitted is generated and provided, in particular for dynamically modifying at runtime the configuration parameters of the logical sequence read that is uniquely linked to the configuration template read.
[0079] Modifications may include changing or adjusting and, if necessary, extending, deleting or supplementing configuration parameters of a logic sequence.
[0080] The modification may be performed manually by a user, or may be performed automatically by another different computer program product through a configuration interface.
[0081] To this end, in a further extension, the configuration parameters of the read logical sequence uniquely linked to the read configuration template can be read through the provided configuration interface and provided to the user for manual modification, for example, through a web application, in particular output on a display screen, for example in the form of a form representation. For example, the modification is determined by changing a preset value.
[0082] Modifications made, for example, by a user or another computer program product are acquired and transmitted to the communication interface generator by means of a configuration interface. The modifications transmitted via the configuration interface are read by the communication interface generator, and the logic sequence read from the library is modified by the communication interface generator based on the read modifications. Now, a logic sequence is present in the communication interface generator, which logic sequence may have modified configuration parameters compared to the original logic sequence in the library.
[0083] Subsequently, a communication interface is generated based on the modified logic sequence by means of a communication interface generator.
[0084] Therefore, according to another extension of the present invention, method step ee. further includes:
[0085] ee. Receive, through the communication interface generator and the configuration interface, a modification of at least one configuration parameter of at least one logical sequence read, and modify at least one configuration parameter of at least one logical sequence read through the communication interface generator.
[0086] And in a further development, method step f. therefore comprises:
[0087] f. Using a communication interface generator, generate at least one communication interface based on the read modified at least one logic sequence.
[0088] Therefore, before the communication interface is generated, the corresponding communication interface can be generated and provided, and the logic sequence can be modified through these communication interfaces. By modifying the logic sequence, the communication interface generated and provided subsequently is also modified.
[0089] The generated communication interface can no longer be modified from the outside. Only internal sequences, such as running counters, can adjust parameters. The computer program product generated according to the invention comprises all communication interfaces, but according to one design form, no configuration interface is provided for the computer program product generated according to the invention. The API product can thus be provided to the user "as a Service" without the need to configure it himself. The generated configuration interface does not need to be embedded in the computer program product.
[0090] Standard values (default values) can be preset for the logic sequences in the library so that the communication interface can also be generated and provided without modification.
[0091] The configuration of the parameters advantageously takes place during the execution of the method according to the invention or during the execution of the computer program product according to the invention.
[0092] Preferably, also during the execution of the method according to the invention or during the execution of the computer program according to the invention, the generation of the communication interface and, if applicable, the configuration interface takes place according to corresponding method steps.
[0093] In particular, all further method steps are also carried out during the execution of the computer program according to the invention, for example the analysis of the source text or the embedding of the generated communication interface into the computer program product.
[0094] According to another extension of the present invention, the library of any and / or any number of semantic annotations can be expanded as necessary. This can also be done during the operation of the method, but in any case before method step d. Correspondingly, before method step d.:
[0095] - provide an input interface for extending, deleting or changing the content of the provided library of semantic annotations;
[0096] - Extend, remove or change the content of the provided library of semantic annotations.
[0097] Therefore, the expansion, deletion or modification, in particular supplementation or adjustment of the content of the provided library of semantic annotations includes the expansion, deletion or modification, in particular supplementation or adjustment of the semantic annotations, i.e., the expressions used to mark the source text structure itself, the logical sequences uniquely linked to the semantic annotations and, if necessary, the configuration templates uniquely linked to the logical sequences.
[0098] For this purpose, the content of the semantically annotated library can be read via a provided input interface and made available to the user for manual extension, deletion or modification, for example via a web application, in particular output on a display screen. Extensions, deletions or modifications, for example made by a user or another computer program product, are captured and written back to the library using the input interface.
[0099] In a further development, the input interface can also be used to extend, delete or modify a source text, in particular a source text read by means of the input interface, in particular to supplement, delete or adjust a semantic annotation constructed from the source text.
[0100] The input interface is designed accordingly.
[0101] A further developed computer program for generating a computer program product correspondingly comprises an input interface for extending, deleting or changing, in particular supplementing or adjusting the content of a provided library and / or for marking at least one source text structure of a source text using at least one semantic annotation in the library.
[0102] The generated communication interface makes it possible, for example, to transmit inputs, for example values, to the artificial intelligence algorithm via a network or from a network, or to output corresponding values from the artificial intelligence algorithm via a network.
[0103] In this case, in a further development, the source text of the artificial intelligence algorithm of the source text marked with the semantic annotation in the library is constructed to respectively describe at least one algorithm for regulating, controlling or diagnosing a technical device or an installation.
[0104] Correspondingly, at least one communication interface generated and provided is used to embed, for example, execute and access via a network at least one source text construction of an artificial intelligence algorithm of a source text marked with at least one semantic annotation, the source text comprising an artificial intelligence algorithm for regulating, controlling, diagnosing or monitoring and / or simulating a technical device, such as a machine or an equipment.
[0105] In a further development, firstly, a source text of a provided artificial intelligence algorithm is transmitted to a source text analysis component by means of an input interface, the source text of the artificial intelligence algorithm comprising at least one semantic annotation of at least one source text structure. A correspondingly further developed computer program comprises an input interface for reading the source text and for transmitting the source text to the source text analysis component.
[0106] The input interface is suitably configured to read a source text of an artificial intelligence algorithm, the source text comprising a semantic annotation as an expression of a source text construct for marking the source text of the artificial intelligence algorithm in the source text. In addition, the input interface is suitably configured to transmit the source text to a source text analysis component.
[0107] The invention has many advantages. Thus, by means of the invention, algorithms and methods implemented in prototypes in the field of artificial intelligence can be easily and cost-effectively transformed into products that can be directly integrated into any customer application and customer process, but without giving customers direct access to the intellectual property rights of the algorithms and methods.
[0108] Various aspects of the invention contribute to significantly improving cost-effectiveness in the production of algorithms and methods in the field of artificial intelligence:
[0109] Self-service for data scientists: The relevant parts of the source texts of algorithms and methods in the field of artificial intelligence remain almost completely unchanged, instead of having to be completely rewritten, as was common until now. Semantic annotation is a very simple concept that data scientists themselves can also directly apply. Therefore, there is no need for software developers to be involved in the production, as is required in similar solutions. This saves a lot of time, because no one other than the original author needs to be familiar with the source text. The coordination overhead between data scientists and software developers is also eliminated.
[0110] Incremental production of existing source texts: Semantic annotations can be added step by step in order to be able to generate further communication interfaces as needed. All parts of the source text that are not annotated are initially disregarded. In this way, incremental production of existing source texts can be achieved very easily. The communication interfaces can be simply controlled by removing or adding semantic annotations. The resulting API product can thus be ideally tailored to the user's requirements.
[0111] Reusability of the generated API products in different contexts: The semantic annotations can be configured with parameters as needed. This configuration is only done during the runtime of the API product via a configuration interface provided for this purpose. This enables the same source text to be used in different usage contexts, for example for different users and / or projects, because when the source text is executed, it can be dynamically adapted to the corresponding applicable requirements.
[0112] Extensibility: The library of semantic annotations used by the present invention can also be supplemented with any additional annotations. As a result, the API product created with the present invention is particularly easy to maintain, since new functions can be easily added when necessary. In addition, this extension mechanism allows the present invention to be used in external application fields outside the production of artificial intelligence algorithms and methods, if semantic annotations suitable for this are created.
[0113] Since the semantically annotated source text markup does not contain information about the communication interface to be generated, it is also possible to map the already annotated source text to other communication interfaces at a later point in time with its help. This increases the future viability and flexibility of the API products created with the invention, since a possible technical migration can be performed later without the involvement of the original author.
[0114] The generated computer program product is a direct method product of the method according to the invention and a result of generating another computer program product by means of the computer program according to the invention. It can be stored on a data carrier. BRIEF DESCRIPTION OF THE DRAWINGS
[0115] The invention allows for numerous embodiments, which are explained in more detail with reference to the following figures, in which design examples are shown.
[0116] Figure 1 An overview of the present invention is shown. DETAILED DESCRIPTION
[0117] Provides a semantic annotation with any number of SA1…SA n (where n is a natural number greater than 1) Library 1. Semantic annotations SA1…SA n Each of is an expression of a source text construct for marking source text using an artificial intelligence algorithm. The annotated source text construct is embedded in the configuration template KV1…KV at runtime. n And the logical sequence LA1…LA n With semantic annotations SA1…SA n Each of the is uniquely linked (here, represented under the same entry in the library).
[0118] Furthermore, a source text analyzing component 2, a communication interface generator 3 and a communication interface providing component 4 are provided.
[0119] The arrows between the modules indicate the connection between them. According to the arrow from the library 1 to the source text analysis component 2, the source text analysis component 2 uses the library. Similarly, the source text analysis component 2 uses the communication interface providing component 4 and the communication interface generator 3, which is shown by the corresponding arrows between the mentioned modules. Similarly, the communication interface generator 3 is used by the communication interface providing component 4.
[0120] The source text constructs of the source text for the artificial intelligence algorithm are marked using semantic annotations provided as expressions in library 1.
[0121] The source text is read and analyzed with the aid of the source text analysis component 2 to see whether a corresponding semantic annotation exists in the library.
[0122] If a source text structure marked with a semantic annotation from the library is identified in the source text, a communication interface is generated by means of a communication interface generator 3 based on a logical sequence uniquely linked to the identified semantic annotation and provided by means of a communication interface provision component 4 .
[0123] This will be outlined in more detail below with the aid of a greatly simplified example implementation.
[0124] First, a source text is generated using an artificial intelligence algorithm, for example by a data scientist whose algorithm is turned into an API product. Here is the source text with two functions using the Python programming language:
[0125] def training_alorithm()
[0126] step1()
[0127] step2()
[0128] def prediction_algorithm()
[0129] step1()
[0130] step2()
[0131] During or after creating the algorithm, the data scientist adds two semantic annotations, @Training and @InteractivePrediction, to mark that the function training_algorithm() involves the training of the analytical model and the function prediction_algorithm() involves the interactive generation of model predictions.
[0132] In this step or in the next step, the data scientist adds declarative type definitions for information exchange between the API and the user. The data scientist also provides corresponding annotations @TrainingData, @PredictionRequest, and @PredictionResponse to indicate when the user should request what information and how the API product should respond. The source text is now as follows:
[0133] @Training
[0134] def training_alorithm(data)
[0135] step1()
[0136] step2()
[0137] @InteractivePrediction
[0138] def prediction_algorithm(data)
[0139] step1()
[0140] step2()
[0141] @TrainingData
[0142] def TrainInput:
[0143] observations:List[float]
[0144] @PredictionRequest
[0145] class Input:
[0146] parameter1:str
[0147] parameter1:str
[0148] @PredictionResult
[0149] class Output:
[0150] result:str
[0151] The source text is then executed. Now, based on all the inserted semantic annotations, when executing the annotated source text, communication interfaces for training and prediction are automatically generated, through which the user can process the two annotated functions over the network. In addition, other standardized interfaces are generated, which can be used to dynamically configure API products and monitor their life cycle.
[0152] In this example, for each semantic annotation, the following information is obtained:
[0153] i. the tags to be used in the source text;
[0154] Example: @InteractivePrediction, used to represent a prediction function;
[0155] ii. constructing a logical sequence into which the annotated source text is embedded at runtime;
[0156] Example: A logical sequence that embeds a prediction function annotated with @InteractivePrediction:
[0157] · Authenticate user requests,
[0158] Execute the annotated prediction function,
[0159] Persistent storage of prediction results to enable subsequent traceability,
[0160] Send the prediction result as a response to the user;
[0161] iii. A configuration template containing the definition of all configuration parameters, using which the logic sequence can be dynamically modified according to the requirements at runtime;
[0162] Example: To match API products to specific needs, such as
[0163] The prediction function annotated with @InteractivePrediction determines how often users are allowed to call the prediction function within a specific time period.
[0164] This example implementation of the present invention is written in Python programming language. It is suitable for generating API products from the following Python source text, which is created using any Python library in the field of data analysis and artificial intelligence available on the market. Therefore, relevant application cases in the field of data analysis and artificial intelligence are covered.
[0165] Semantic annotations are implemented with the help of so-called Python Dekorators. Currently the following types of semantic annotations are available:
[0166] -Definition of communication interface:
[0167] o User-defined initialization of API products
[0168] o Training of analytical models
[0169] o Interactive generation of forecasts
[0170] o Asynchronous generation of predictions
[0171] o Start a batch job
[0172] oStart a data stream processing job
[0173] o Handle customer feedback on previously made forecasts
[0174] - Definition of the information to be exchanged:
[0175] oGraphical definition of common configuration parameters
[0176] oDefinition of the graph of the prediction request
[0177] oDefinition of a graph of responses to prediction requests
[0178] o Definition of a graph for analyzing the model’s hyperparameters
[0179] oDefinition of a graph of the training data used to analyze the model
[0180] o Definition of a graphical representation of user feedback on previously made predictions
[0181] For example, REST is used as the communication interface. These interfaces follow the OpenAPI standard and are therefore self-describing. Users can integrate the generated API products into numerous applications and processes through the available public source text generator.
Claims
1. A computer-implemented method for generating a computer program product from a source text based on an artificial intelligence algorithm, the source text having at least one source text construct marked with at least one semantic annotation, the method comprising the following method steps: a. Providing a semantically annotated library (1), the semantically annotated library comprising: -Semantic annotations (SA1…SA n ), source text construction for labeling source text for artificial intelligence algorithms; - with semantic annotations (SA1…SA n ) uniquely linked logical sequence (LA1…LA n ), for generating a communication interface and for embedding the marked source text constructs; b. Provide a source text analysis component (2) for analyzing the source text to determine Is there a semantic annotation (SA1…SA n ); c. Providing a communication interface generator (3) for generating at least one communication interface; d. Analyze the source text with the help of the source text analysis component (2) to determine whether there is at least one semantic annotation (SA1...SA n ), and transmits at least one of the following logic sequences in the library (1) to the communication interface generator (3), This logical sequence corresponds to at least one semantic annotation (SA1… S n ) uniquely links; e. reading the transmitted at least one semantic annotation (SA1 ... SA1) existing in the source text by the communication interface generator (3) n ) links at least one logical sequence (LA1…LA n );as well as f. Using the communication interface generator (3) based on the read at least one logical sequence (LA1 ... LA n ) generating at least one communication interface; g. Embedding the generated at least one communication interface into the computer program product middle.
2. The method according to claim 1, characterized in that Prior to method step a.: - using at least one semantic annotation (SA1) from the library of semantic annotations (1) …SA n ) Mark at least one source in the source text of the artificial intelligence algorithm Text construction.
3. The method according to claim 1 or 2, characterized in that: The method additionally comprises the following method steps before method step e.: cc provides a communication interface providing component (4); In the method step f., at least one communication interface generated by the communication interface generator (3) is transmitted to the communication interface providing component (4), Wherein, method step g. is performed by the communication interface providing component (4), And wherein, after method step g.: h. Providing the generated computer program product through the communication interface providing component (4).
4. The method according to any one of claims 1 to 3, characterized in that The semantically annotated library (1) provided according to method step a. comprises at least one configuration template (KV1 . . . KV n ), the configuration template and at least one logical sequence (LA1...LA n ) are uniquely linked, and the configuration template includes a method for modifying the logical sequence (LA1 ... LA n ) configuration parameters, Therein, method steps d. and e. additionally comprise: d. The library (1) and at least one logical sequence (LA1 ... LA n ) At least one configuration template (KV1...KV n ) is transmitted to the Communication interface generator (3); e. Reading at least one configuration template (KV1 ... KV1) transmitted by the communication interface generator (3) n ), the at least one configuration module transmitted and the at least one logical sequence transmitted (LA1 ... LA n ) uniquely links; Therein, after method step e. and before method step f.: ee. Based on the at least one logical sequence (LA1 ... LA1) read by the communication interface generator (3), n ) and based on the at least one configuration template (KV1 . . . KV n ), generating at least one configuration interface, and providing the generated at least one configuration interface to read at least one logical sequence (LA1 ... LA n ) to make modifications.
5. The method according to claim 4, characterized in that Method step ee. additionally comprises: ee. Receiving at least one logical sequence read by the configuration interface (LA1 …LA n ) and by the communication interface generator (3) At least one logical sequence (LA1…LA n ) change; Wherein, method step f. comprises: f. With the aid of the communication interface generator (3) based on at least one modified logical sequence (LA1 ... LA n ), generating at least one communication interface.
6. The method according to any one of claims 1 to 5, characterized in that According to method step f., at least one communication interface is generated as an application programming interface by means of the communication interface generator (3).
7. The method according to any one of claims 1 to 6, characterized in that Prior to method step d.: - Provides an input interface for receiving functions that extend, delete, or change the provided semantics Input of the contents of the annotated library (1); - Expand, delete or change the provided semantic annotation based on the input (SA1... S n )'s library contents.
8. The method according to any one of claims 1 to 7, characterized in that At least one semantic annotation (SA1…SA1) in the library (1) is used n ) The source text structure of the source text of the artificial intelligence algorithm marked includes at least one algorithm for regulating, controlling, diagnosing, monitoring or simulating a technical device or equipment.
9. A computer program for producing a computer program product, the computer program comprising instructions which, when executed by a suitable computer, cause the computer to perform the method according to any one of claims 1 to 8.
10. The computer program according to claim 9, characterized in that The computer program comprises: - a semantically annotated library (1), the semantically annotated library comprising: -Semantic annotations (SA1…SA n ), source text construction for labeling source text for artificial intelligence algorithms; - with semantic annotations (SA1…SA n ) uniquely linked logical sequence (LA1… LA n ), for generating a communication interface and for embedding the marked source text structure make; - a source text analysis component (2), which is suitably designed to: - used to analyze the source text to determine whether the semantic annotations (SA1...SA1) in the library (1) exist in the source text n ); - for converting at least one logical sequence (LA1 . . . LA n ) The logic sequence is transmitted to the communication interface generator (3), and the logic sequence is consistent with at least one semantic annotation (SA1 ... SA2) present in the source text. n ) uniquely links; - a communication interface generator (3), which is suitably designed to: - for reading at least one semantic annotation transmitted and present in the source text (SA1…SA n ) links at least one logical sequence (LA1…LA n );as well as - for at least one logical sequence (LA1 . . . LA n ) generating at least one communication interface; - used for transmitting the generated at least one communication interface to a communication interface providing component (4); - a communication interface providing component (4), which is suitably configured to: - for embedding the generated at least one communication interface into the computer program product Product.
11. The computer program according to claim 9 or 10, characterized in that The computer program comprises an input interface, which is suitably configured to: - reading a source text of an artificial intelligence algorithm, said source text comprising at least one semantic annotation (SA1 ... SA n ), used to mark AI algorithms in source text at least one source text construction of a source text of a law; - The read source text is transmitted to the source text analysis component (2).
12. A computer program according to any one of claims 9 to 11, comprising an input interface for receiving input for extending, deleting or modifying the content of the library (1) of provided semantic annotations, and / or for utilizing at least one semantic annotation (SA1 ... SA2) in the library (1) n ) marks at least one source text construct of a source text.
13. A data carrier on which a computer program according to any one of claims 9 to 12 is stored.
14. A computer program product produced using the method according to any one of claims 1 to 8.
15. A data carrier on which a computer program product according to claim 14 is stored.
