Semantic layout document generation method and apparatus

By adding semantic annotation records to streaming documents and performing metadata conversion during the conversion process, a semantic layout document is generated, which solves the problem of insufficient utilization of semantic information in streaming document format conversion and improves the machine readability and intelligent processing capabilities of the document.

CN116108855BActive Publication Date: 2026-01-16BEIJING INFORMATION SCI & TECH UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310060570.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-17
Publication Date
2026-01-16
Estimated Expiration
2043-01-17

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively utilize the semantic information of documents when converting streaming document formats to layout document formats, resulting in insufficient machine readability and intelligent processing capabilities.

Method used

By adding semantic annotation records to streaming documents and converting the semantic annotation information into layout semantic metadata during the format conversion process, semantic layout documents are generated, realizing the metadata conversion and storage of semantic information between streaming and layout documents.

Benefits of technology

It improves the ability to utilize semantic information when switching between layout and streaming formats, and enhances the machine readability and intelligent processing capabilities of documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116108855B_ABST
    Figure CN116108855B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a semantic format document generation method and device. A specific implementation of the method comprises: storing document semantic metadata information added in a target streaming document in the form of semantic annotation records; storing the target streaming document and the semantic annotation records correspondingly to obtain a semantic streaming document; in response to detecting a first document format conversion operation for the semantic streaming document, writing semantic content into a target format semantic metadata file, wherein the target format semantic metadata file is stored in a pre-defined format semantic annotation record format; converting the target streaming document included in the semantic streaming document into a target format document; and fusing the target format semantic metadata file and the target format document to generate a semantic document in a target format as a semantic format document. The implementation can accurately and conveniently generate a semantic format document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments disclosed herein relate to the field of computer technology, and more specifically to a method and apparatus for generating semantic layout documents.

[0002] Basic Terminology

[0003] (1) A streaming document is a document that conforms to the streaming document format specification (OOXML, ODF, UOF, etc.).

[0004] (2) Semantic streaming document: A streaming document with semantic files is a semantic file with semantic tags that is stored as a file after semantics is added to the original streaming document and the semantic record format is defined. That is, semantic information is added to the streaming document format and packaged together in the streaming document to form a semantic streaming document.

[0005] (3) Documents with semantic information: Documents with corresponding semantic tag information added to the streaming document.

[0006] (4) Word processing software: software used to create, edit and browse streaming documents (e.g., office software).

[0007] (5) Streaming document format: There are currently three main streaming document format standards: OOXML (Office Open XML) format, ODF (Open Fixed-layout Document) format and UOF (Uniform Officedocument Format) format.

[0008] (6) Layout document format: The main layout document formats currently include PDF format and OFD format.

[0009] (7) Semantic layout document: After completing the conversion from streaming document to layout document format, the content of the semantic metadata record of the target layout document is inserted into the metadata stream of the layout document, and the generated semantic layout document is stored. Background Technology

[0010] Streaming documents contain rich semantic information. To further leverage the value of the data within streaming documents and enhance their machine readability, adding semantic metadata will facilitate efficient document retrieval, information extraction, and intelligent processing such as machine understanding. Ensuring the full utilization of semantic information throughout the entire process from streaming format generation to formatted archiving is a pressing issue that needs to be addressed.

[0011] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure, and therefore, it can contain information that does not form the prior art that is already known in this country to those of ordinary skill in the art. SUMMARY

[0012] This brief summary of the disclosure is provided for the purpose of introducing some concepts of the present disclosure in a simplified form that are further described in the detailed description. This brief summary of the disclosure is not intended to identify key features or essential features of the claimed technology nor is it intended to be used to limit the scope of the claimed technology.

[0013] Some embodiments of the present disclosure propose a semantic format document generation method and device to solve the technical problems mentioned in the background section.

[0014] In a first aspect, some embodiments of the present disclosure provide a semantic format document generation method, comprising: storing document semantic metadata information added in a target stream document in the form of semantic annotation as a semantic annotation record; storing the target stream document and the semantic annotation record correspondingly to obtain a semantic stream document; in response to detecting a first document format conversion operation on the semantic stream document, writing semantic content of a semantic annotation information set of the semantic annotation record in the semantic stream document into a target format semantic metadata file, wherein the target format semantic metadata file is stored in a pre-defined format semantic annotation record format; converting a target stream document included in the semantic stream document into a target format document; and fusing the target format semantic metadata file and the target format document to generate a semantic document of a target format as a semantic format document.

[0015] In a second aspect, some embodiments of the present disclosure provide a semantic format document generation device, comprising: a first storage unit configured to store document semantic metadata information added in a target stream document in the form of semantic annotation as a semantic annotation record; a second storage unit configured to store the target stream document and the semantic annotation record correspondingly to obtain a semantic stream document; a writing unit configured to, in response to detecting a first document format conversion operation on the semantic stream document, write semantic content of a semantic annotation information set of the semantic annotation record in the semantic stream document into a target format semantic metadata file, wherein the target format semantic metadata file is stored in a pre-defined format semantic annotation record format; a document conversion unit configured to convert a target stream document included in the semantic stream document into a target format document; and a fusion unit configured to fuse the target format semantic metadata file and the target format document to generate a semantic document of a target format as a semantic format document.

[0016] The above various embodiments of the present disclosure have the following beneficial effects: the semantic flow document generation method of some embodiments of the present disclosure generates a semantic flow document in a manner of adding semantic annotations, and when format conversion is performed between the format of the document, metadata conversion and storage are performed between the semantic annotation record of the flow and the semantic metadata record of the format document, so that the semantic metadata information of the document can be used at any time when the document is switched between the format and the flow, and the reusability of the document is greatly improved. Similarly, the developed tool has important use value and role. BRIEF DESCRIPTION OF DRAWINGS

[0017] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent by describing in detail the embodiments thereof with reference to the attached drawings in which:

[0018] Figure 1 is a flow chart of some embodiments of the semantic format document generation method according to the present disclosure;

[0019] Figures 2-3 is a packaging storage structure diagram showing that the target flow document and the semantic annotation record are packaged together to form a semantic flow document;

[0020] Figure 4 is a schematic diagram showing the conversion system interface between the Word format and the PDF format;

[0021] Figure 5 is a schematic diagram of the system interface showing the mutual conversion between the semantic metadata in the form of annotations and the semantic metadata in the form of separation;

[0022] Figure 6 is a structural schematic diagram of some embodiments of the semantic format document generation device according to the present disclosure. DETAILED DESCRIPTION

[0023] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes, and are not intended to limit the scope of protection of the present disclosure.

[0024] In addition, it should be noted that only the parts related to the invention are shown in the drawings for ease of description. The embodiments in the present disclosure and the features in the embodiments can be combined with each other without conflict.

[0025] It should be noted that the terms "first", "second", and the like in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units.

[0026] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one or more" should be understood unless otherwise explicitly indicated in the context.

[0027] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are only for illustrative purposes, and are not intended to limit the scope of the messages or information.

[0028] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0029] Reference Figure 1 , shows the flow 100 of some embodiments of the semantic layout document generation method according to the present disclosure. The semantic layout document generation method includes the following steps:

[0030] Step 101, store the document semantic metadata information added in the form of semantic annotation in the target streaming document as a semantic annotation record.

[0031] In some embodiments, the subject (for example, an electronic device) of the above-mentioned semantic layout document generation method can store the document semantic metadata information added in the form of semantic annotation in the target streaming document as a semantic annotation record. Wherein, the target streaming document can be a streaming document to be added with semantic information. The document semantic metadata information can be the semantic information to be added to the target streaming document. The above-mentioned semantic information can be the semantic content describing the added object in the target streaming document.

[0032] Here, the above-mentioned subject can add the document semantic metadata information to the target streaming document through a specific platform, software or API (Application Program Interface).

[0033] For example, the streaming document adds semantic information to the target streaming document in the target document processing platform. Wherein, in the target document processing platform, not only can the semantic information be added to the target streaming document in the form of annotation, but also can be added in the form of bookmark, annotation, etc. to record the semantic information in the streaming document format record. This adding method can be directly supported and parsed by the streaming document processing tool.

[0034] In addition, the above execution subject can also add semantic information to the target streaming document by using development software or direct API programming. This adding method only meets the semantic annotation adding rules, and the added document may not be directly supported and parsed by the streaming document processing tool.

[0035] The semantic information in the form of annotation is added directly to the streaming document developed by the document processing platform. The username of the added semantic annotation is "Metadata", the annotation object (the content to be annotated) is "Scientists discover 'XXX", the annotation range (the range of the annotation) is the range corresponding to the vertical lines at both ends of the content, the annotated content name description is "headline", and the annotation content is "Scientists discover 'XXX' in the ocean". <rdf:rdf>The tags represent the corresponding specific semantics.

[0036] In practice, for the addition of the annotation metadata in the target streaming document, the metadata content of Table 1 can be implemented.

[0037]

[0038] Table 1

[0039] In some optional implementations of some embodiments, the above-mentioned document semantic metadata information is generated by the following steps:

[0040] In the first step, at least one document basic description information and at least one document entity object of the target streaming document are obtained as a semantic annotation element set. The document basic description information can be the basic description information of the document. Specifically, the at least one document basic description information can include but is not limited to at least one of the following: title, author, creation time. The document entity object can be an entity object involved in the target streaming document. Specifically, the at least one document entity object can include but is not limited to at least one of the following: named entity, chart image.

[0041] In the second step, the target format semantic element tag and semantic representation content corresponding to each semantic annotation element in the above-mentioned semantic annotation element set are generated by a target method as semantic annotation information, and a semantic annotation information set is obtained. The above-mentioned target method can be a method using a specific platform, software or API. The above-mentioned target method can also be a method using a development software or a direct API programming method. The above-mentioned target format can be an XML format.

[0042] Here, semantic annotation can be adding corresponding semantic element tags and semantic representation content to document semantic information, and each semantic element has a certain hierarchical structure. The semantic element tag and the semantic element hierarchical structure can be represented by the tag of XML and XML Schema. The semantic element tag at least needs to define the correspondence between the vocabulary, the word and the original content, and the related tags corresponding to the annotation content, such as the metadata name tag, the position range tag, the annotation content tag, etc.

[0043] In the third step, the document semantic metadata information for the above-mentioned semantic annotation information set is generated according to the semantic element hierarchical structure corresponding to each semantic annotation element in the above-mentioned semantic annotation element set. The semantic element hierarchical structure can be constructed based on the relationship between the semantic elements.

[0044] In some optional implementations of some embodiments, the document semantic metadata information added in the target streaming document in the form of semantic annotation is stored as a semantic annotation record, which can include the following steps:

[0045] In a first step, in response to determining that the semantic annotation record is recorded in a scattered form to the record of the streaming document, each semantic annotation information in the obtained semantic annotation information set is recorded in a data block form to the position of the semantic annotation corresponding to the target streaming document to generate an annotation unit, and an annotation unit set is obtained.

[0046] Specifically, if the semantic annotation operation is added to the target streaming document based on an office software processing software or based on a corresponding format API, etc., the format record form of the used comment, bookmark, annotation, etc. can be directly recorded and stored in the format record with the corresponding semantic mark.

[0047] For example, the semantic annotation is added in the form of comment, and the corresponding semantic mark is the username "Metadata".

[0048] In this way, the semantic annotation is scattered in the OOXML streaming document format record, and the advantage is that it can be directly parsed, displayed and processed by the office document software.

[0049] In a second step, the semantic mark is uniformly specified for the annotation unit set to generate a semantic annotation record.

[0050] In a third step, in response to determining that the semantic annotation record is in the form of a semantic file, the annotation unit set is summarized to an initial semantic file to generate a summarized semantic file as the semantic annotation record.

[0051] As an example, the label defined for the summarized semantic file is mainly the title (schema: headline) "Scientists discover XXX " corresponding to the first to 56th Unicode characters in the first paragraph of the streaming document (http: / / docpath / name.docx).

[0052] It should be noted that the summarized semantic file can be composed of a plurality of description (Description) elements, and each description element is composed of a position (Location) element representing the position of the document and a Metadata XML element representing the semantic metadata. The position element can be a string, which represents the document area. The Metadata XML element is the semantic metadata expressed in RDF.

[0053] The semantic file is saved separately.

[0054] The saved file name is "semanticData.xml".

[0055] Similarly, referring to the following example, the saved file name can also be "semanticData.xml". The example has relatively more semantic tags in the corresponding semantic file.

[0056] <?xml version="1.0" encoding="UTF-8"?>

[0057] <dsm:Meta xmlns:vc="http: / / www.w3.org / 2007 / XMLSchema-versioning"

[0058] xmlns:xsi="http: / / www.w3.org / 2001 / XMLSchema-instance"

[0059] xmlns:dsm="http: / / document-semantic-metadata">

[0060] <dsm:description>

[0061] <dsm:location>http: / / docpath / name.docx#P1F1-56< / dsm:location>

[0062] <dsm:metadataxml>

[0063] <rdf:rdf xmlns:schema="http: / / schema.org / " xmlns:rdf="http: / / www.w3.org / 1999 / 02 / 22-rdf-syntax-ns#">

[0064] <schema:newsarticle rdf:about="http: / / docpath / name.docx#P1F1-56">

[0065] <schema:headline>Scientists discover 'ghost' fossils beneath amicroscope< / schema:headline>

[0066] < / schema:newsarticle>

[0067] < / rdf:rdf>

[0068] < / dsm:metadataxml>

[0069] < / dsm:description>

[0070] <dsm:description>

[0071] <dsm:location>http: / / docpath / name.docx#P3F1-20< / dsm:location>

[0072] <dsm:metadataxml>

[0073] <rdf:rdf xmlns:schema="http: / / schema.org / " xmlns:rdf="http: / / www.w3.org / 1999 / 02 / 22-rdf-syntax-ns#">

[0074] <schema:newsarticle rdf:about="http: / / docpath / name.docx#P3F1-20">

[0075] <schema:name>By Ashley Strickland< / schema:name>

[0076] < / schema:newsarticle>

[0077] < / rdf:rdf>

[0078] < / dsm:metadataxml>

[0079] < / dsm:description>

[0080] <dsm:description>

[0081] <dsm:location>http: / / docpath / name.docx#P4F1-36< / dsm:location>

[0082] <dsm:metadataxml>

[0083] <rdf:rdf xmlns:schema="http: / / schema.org / " xmlns:rdf="http: / / www.w3.org / 1999 / 02 / 22-rdf-syntax-ns#">

[0084] <schema:newsarticle rdf:about="http: / / docpath / name.docx#P4F1-36">

[0085] <schema:datemodified>Updated 4:03 PM ET, Thu May 19, 2022< / schema:datemodified>

[0086] < / schema:newsarticle>

[0087] < / rdf:rdf>

[0088] < / dsm:metadataxml>

[0089] < / dsm:description>

[0090]

[0091] Step 102, store the target stream document and the semantic annotation record correspondingly to obtain a semantic stream document.

[0092] In some embodiments, the execution subject can store the target stream document and the semantic annotation record correspondingly to obtain a semantic stream document.

[0093] In some optional implementations of some embodiments, the storing of the target stream document and the semantic annotation record to obtain a semantic stream document can include the following steps:

[0094] First, in response to determining that the semantic annotation record is in the form of a semantic file, the target stream document and the semantic annotation record in the form of a semantic file are packaged to generate a semantic stream document.

[0095] Referring to Figures 2-3 , a packaging storage structure diagram of packaging the target stream document and the semantic annotation record together to form a semantic stream document is shown. The semantic annotation record is in the form of an independent file, which is the semanticData.xml file in the figure.

[0096] Secondly, in response to determining that the semantic annotation record is recorded in a scattered form in the streaming document, the target streaming document recording the annotation unit set is determined as a semantic streaming document.

[0097] In some optional implementations of some embodiments, after step 102, the steps further include:

[0098] Firstly, in response to receiving a conversion request, the semantic annotation record in the semantic streaming document is extracted. The conversion request can be a request for semantic annotation record.

[0099] Secondly, the document semantic metadata information is extracted from the semantic annotation record.

[0100] For the semantic streaming document, when receiving the conversion request sent by the document processing software, the semantic metadata extracted from semanticData.xml in the semantic streaming document is extracted. The metadata extracted from semanticData.xml in the embodiment can refer to Table 1.

[0101] It should be noted that the extracted metadata information is mainly used to describe the annotated object, range and annotation content, and is mapped to the corresponding tags such as annotations, bookmarks, notes and the like supported by the streaming document format. For example, taking the annotation form as an example, the extracted annotated object and range are used as the OOXML format <commentrange>in the start and end tags of the extracted annotation content as the content of the comment and put into <comment>The tag. Specifically, it can be written into the OOXML stream document corresponding to the comment format record through API and the like.

[0102] In the present embodiment, the OOXML file is extracted and written into the comment, and the xml is identified and turned into the comment. According to the XML Schema structure of the file, the comment is extracted <dsm:location>The content in the tag is parsed into the content of "character P" to "character F", the content of "character F" to "character '-'", and the content after "character '-'. The content of "character P" to "character F" indicates the paragraph number in the document, the content of "character F" to "character '-' " indicates the character number from the beginning of the paragraph, and the content after "character '-' " indicates the character number from the end of the paragraph. The corresponding paragraph and character in the document are located by using the streaming document operation interface or function (for example, the function provided by Spire.Doc), so that the specified content of the paragraph is annotated. The sub-tags of the < rdf: RDF> tag are parsed, and the name of the sub-tag is parsed. The sub-tags of the sub-tags are parsed, the name and content are parsed, the tag indicates a semantic tag, and the specific vocabulary table to which the tag belongs is identified according to the prefix of the tag. Then, the vocabulary table and the word are annotated according to the above annotation format. By using the streaming document operation interface or function, the paragraph position can be written back to the streaming document format.

[0103] In the third step, the document semantic metadata information is mapped and written into the corresponding position of the target streaming document in the form of annotations, bookmarks, comments and other forms supported by the streaming document format, to generate a semantic document with semantic information. The semantic document with semantic information supports correct parsing, display and editing of the document and the corresponding semantic information by the document processing software platform. The target mapping relationship is a mapping relationship representing the association between the document content of the target streaming document and the semantic annotation information set in the document semantic metadata information, which is established based on the semantic annotation record.

[0104] In the fourth step, in response to detecting an editing operation on the semantic document, the semantic document is edited to obtain an edited semantic document.

[0105] Here, after adding, deleting and modifying semantic annotations to the semantic document with semantic information, the semantic streaming document is synchronized. For the added semantic annotation, the added semantic annotation is converted into a semantic annotation record according to the semantic annotation order and is written into the semantic streaming document. For the operation of deleting the semantic annotation, the semantic annotation order is recorded before the deletion operation is triggered. The semantic annotation is deleted in the semantic document with semantic information, and the corresponding semantic annotation in the semantic streaming document is deleted. The semantic annotation record with the same semantic number is also deleted. For the modified semantic annotation, the corresponding semantic annotation record in the semantic streaming document is modified according to the order of the modified semantic annotation.

[0106] After recording the semantic metadata in the form of annotations in the target streaming document, the effect diagram of the document processing software opening the semantic document with semantic information.

[0107] In the fifth step, the semantic streaming document is updated according to the edited semantic document to obtain an updated semantic streaming document.

[0108] In some optional implementations of some embodiments, the updating of the semantic streaming document according to the edited semantic document to obtain an updated semantic streaming document can include the following steps:

[0109] In the first step, the data representation format of the document semantic metadata information included in the semantic streaming document is determined.

[0110] In the second step, the edited semantic document is mapped into a semantic document in the data representation format as a mapped semantic document.

[0111] In the third step, the document semantic metadata information in the semantic streaming document is replaced by the mapped semantic document to obtain a replaced semantic streaming document as an updated semantic streaming document.

[0112] In step 103, in response to detecting the first document format conversion operation for the semantic streaming document, the semantic content of the semantic annotation information set of the semantic annotation record in the semantic streaming document is written into a target format semantic metadata file.

[0113] In some embodiments, in response to detecting the first document format conversion operation for the semantic streaming document, the execution subject can write the semantic content of the semantic annotation information set of the semantic annotation record in the semantic streaming document into a target format semantic metadata file. The target format semantic metadata file is stored in a pre-defined format semantic annotation record format.

[0114] It should be noted that when the semantic content of the semantic annotation information set of the semantic annotation record is written into the target format semantic metadata file, the semantic annotation information set can be recorded in a dispersed form in the streaming document or in an integrated form in the streaming document. That is, the semantic content of the semantic annotation information set can be written into the target format semantic metadata file in a dispersed form or in an integrated form.

[0115] The location and the annotated data are respectively put into dsm:Location and dsm:MetadataXML, and the picture metadata is put into <dsm:imagex>The XMP of the extensible metadata platform is a metadata representation framework supported by PDF format document, and XMP is taken as a target format document semantic metadata record format. Here, the storage of format document metadata can be completed by using the XMP framework. The XML framework provides standardized metadata processing and interactive operation of metadata.

[0116] It should be noted that in the process of converting the flow document into the format document, the extraction of the picture metadata can be realized by Table 2.

[0117]

[0118] Table 2

[0119] As an example, the OOXML format document is converted into PDF, and the XMP file is inserted into the metadata stream of the PDF. (Specifically, XMP is fused with the format PDF, so that the corresponding PDF document has semantic metadata description, forming a PDF document with semantics).

[0120] Referring to Figure 4 , a schematic diagram of a system interface for conversion between Word format and PDF format is shown.

[0121] Referring to Figure 5 , a schematic diagram of a system interface for mutual conversion between semantic metadata in the form of annotations and semantic metadata in the form of separation is shown.

[0122] In some optional implementations of some embodiments, the execution subject can convert the position correspondence between the metadata and the document content in the semantic flow document into the position correspondence between the metadata and the document content in the format document, and write the correspondence between the glossary, the word, and the original content and the annotation content in each semantic annotation information in the semantic annotation information set into the target format semantic metadata file, wherein the correspondence with the original content includes the position correspondence information of the semantic annotation information. The semantic content of the semantic annotation information includes the correspondence between the glossary, the word, and the original content and the annotation content.

[0123] In practice, the execution subject can convert the correspondence between the metadata and the document content in the semantic flow document into the correspondence between the metadata and the document content in the semantic format document. The dsm:Location element in the separation file of the semantic flow document can be: <dsm:location>http: / / docpath / name.docx#P3F1-20< / dsm:location> ". Where "http: / / docpath / name.docx" can represent the current file, "P[idl]-[id2]" can represent the paragraph range covered by the annotation. "F[idl]-[id2]" can be the character range covered by the annotation. "idl" can be the start serial number of the paragraph (character), and "id2" can be the end serial number of the paragraph (character).

[0124] It should be noted that when the semantic flow document is converted to the semantic layout document, the annotations corresponding to the semantic metadata are also converted. In the semantic layout document, the coordinates of the semantic metadata can be viewed in the XMP data package in the metadata stream, and the annotations of the semantic metadata can also be viewed when the semantic layout document is opened. Here, in response to determining that the annotations of the semantic metadata in the document are lost, the annotations can be recovered according to the semantic metadata location in the XMP data package.

[0125] For the following layout document:

[0126] "dsm:Location>http: / / pdfpath / name.pdf#P1Rect[129.8,707.5,469.95,769.9]< / dsm:imagex> < / dsm:location> ”

[0127] The semantic metadata position in the semantic layout document is the coordinate of the comment. In the corresponding document (http: / / pdfpath / name.pdf), the position of the lower left corner coordinate (129.8, 707.5) and the upper right corner coordinate (469.95, 769.9) of the first page.

[0128] Step 104, converting the target stream document included in the semantic stream document into a target layout document.

[0129] In some embodiments, the execution subject can convert the target stream document included in the semantic stream document into a target layout document.

[0130] Step 105, fusing the target layout semantic metadata file and the target layout document to generate a semantic document of the target layout as a semantic layout document.

[0131] In some embodiments, the execution subject can fuse the target layout semantic metadata file and the target layout document to generate a semantic document of the target layout as a semantic layout document.

[0132] In some optional implementations of some embodiments, the fusion of the target layout semantic metadata file and the target layout document to generate a semantic document of the target layout as a semantic layout document can include the following steps:

[0133] First, in response to determining that the semantic layout document is a document in the form of content insertion into the target layout document, the target layout semantic metadata file is embedded into the metadata stream corresponding to the target layout document according to the rules described by the metadata of the target layout document, to obtain the semantic layout document.

[0134] Second, in response to determining that the semantic layout document is a document in the form of file packaging, the target layout semantic metadata file and the target layout document are packaged to obtain the semantic layout document.

[0135] In some optional implementations of some embodiments, after step 105, the step further includes:

[0136] In response to detecting a second document format conversion operation for the semantic layout document, the semantic layout document is converted into a corresponding semantic flow document.

[0137] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: the semantic flow document is generated in an added semantic annotation manner by the semantic layout document generation method of some embodiments of the present disclosure, and when the format conversion is performed between the layout flow of the document, the metadata conversion storage is performed between the semantic annotation record of the flow and the semantic metadata record of the layout document, so that the semantic metadata information of the document can be used at any time when the document is switched between the layout and the flow, and the reusability of the document is greatly improved. Similarly, the developed tool has important use value and role.

[0138] Further referring to Figure 6 , as an implementation of the method shown in the above-mentioned figures, the present disclosure provides some embodiments of a semantic layout document generation apparatus, which corresponds to the method embodiments shown in Figure 1 , and the semantic layout document generation apparatus can be specifically applied to various electronic devices.

[0139] As shown in Figure 6 , a semantic layout document generation apparatus 600 includes a first storage unit 601, a second storage unit 602, a writing unit 603, a document conversion unit 604, and a fusion unit 605. The first storage unit 601 is configured to store the document semantic metadata information added in the form of semantic annotation in a target flow document as a semantic annotation record; the second storage unit 602 is configured to store the target flow document and the semantic annotation record correspondingly to obtain a semantic flow document; the writing unit 603 is configured to write the semantic content of the semantic annotation information set of the semantic annotation record in the semantic flow document into a target layout semantic metadata file in response to detecting a first document format conversion operation for the semantic flow document, wherein the target layout semantic metadata file is stored as a pre-defined layout semantic annotation record format; the document conversion unit 604 is configured to convert a target flow document included in the semantic flow document into a target layout document; and the fusion unit 605 is configured to fuse the target layout semantic metadata file and the target layout document to generate a target layout semantic document as a semantic layout document.

[0140] It can be understood that the units recorded in the semantic layout document generation apparatus 600 correspond to the respective steps in the method described with reference to Figure 1 . Therefore, the operations, features and beneficial effects described above for the method also apply to the semantic layout document generation apparatus 600 and the units contained therein, and will not be described here again.

[0141] The above description is merely exemplary of some embodiments of the present disclosure and the technical principles of the application. It should be understood by those skilled in the art that the scope of the application involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by the combinations of the above technical features or equivalent features without departing from the above inventive concept. For example, the above features and the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) are replaced with each other to form a technical solution.< / comment> < / commentrange> < / rdf:rdf>

Claims

1. A semantic layout document generation method, comprising: storing document semantic metadata information added in a target flow document in a form of semantic annotation record, the document semantic metadata information being generated by the following steps: obtaining at least one document base description information and at least one document entity object for the target flow document as a set of semantic annotation elements; generating, by a target mode, a semantic element label and semantic representation content of each semantic annotation element in the set of semantic annotation elements in a target format as semantic annotation information to obtain a set of semantic annotation information; generating document semantic metadata information for the set of semantic annotation information according to a semantic element hierarchy corresponding to each semantic annotation element in the set of semantic annotation elements; storing the target flow document and the semantic annotation record correspondingly to obtain a semantic flow document; in response to detecting a first document format conversion operation for the semantic flow document, writing semantic content of the set of semantic annotation information of the semantic annotation record in the semantic flow document into a target layout semantic metadata file, wherein the target layout semantic metadata file is stored in a pre-defined layout semantic annotation record format; converting the target flow document included in the semantic flow document into a target layout document; fusing the target layout semantic metadata file and the target layout document to generate a semantic document in a target layout as a semantic layout document.

2. The method of claim 1, wherein, After the storing the target flow document and the semantic annotation record correspondingly to obtain a semantic flow document, the method further comprises: in response to receiving a conversion request, extracting the semantic annotation record in the semantic flow document; extracting document semantic metadata information from the semantic annotation record; mapping and writing the document semantic metadata information into a corresponding position of a comment, a bookmark, and a note label in the target flow document by a target mapping relationship to generate a semantic document with semantic information, wherein the semantic document with semantic information supports correct parsing, display, and editing of the document and corresponding semantic information by a document processing software platform, and the target mapping relationship is a mapping relationship representing a correlation between document content of the target flow document and the set of semantic annotation information in the document semantic metadata information based on the semantic annotation record; in response to detecting an editing operation for the semantic document, editing the semantic document to obtain an edited semantic document; updating the semantic flow document according to the edited semantic document to obtain an updated semantic flow document.

3. The method of claim 1, wherein, The storing document semantic metadata information added in a target flow document in a form of semantic annotation record comprises: in response to determining that the semantic annotation record is recorded in a scattered form to the flow document, recording each semantic annotation information in the obtained set of semantic annotation information in a form of data block to a corresponding semantic annotation position of the target flow document to generate an annotation unit to obtain a set of annotation units; The semantic annotation information set of the semantic annotation record in the semantic streaming document is written into a target format semantic metadata file, including: The position correspondence relationship between the metadata and the document content in the semantic streaming document is converted into the position correspondence relationship between the metadata and the document content in the format document, and the vocabulary, the word, the correspondence relationship with the original text content, and the annotation content in each semantic annotation information in the semantic annotation information set are written into the target format semantic metadata file, wherein the correspondence relationship with the original text content includes position correspondence relationship information of the semantic annotation information.

4. The method of claim 3, wherein, The target format semantic metadata file and the target format document are fused to generate a semantic document of a target format as a semantic format document, including: In response to determining that the semantic format document is recorded in the target format document in a content insertion form, the target format semantic metadata file is embedded into a metadata stream corresponding to the target format document according to rules described by embedded metadata, to obtain a semantic format document; In response to determining that the semantic annotation record is recorded in the streaming document in a scattered form, a target streaming document recording the annotation unit set is determined as a semantic streaming document.

5. The method of claim 2, wherein, The method further includes: In response to detecting a second document format conversion operation for the semantic format document, the semantic format document is converted into a corresponding semantic streaming document.

9. A semantic format document generation apparatus, comprising: ​ 6. The method of claim 1, wherein, ​ ​ ​ 7. The method of claim 1, wherein, ​ ​ ​ 8. The method of claim 1, wherein, ​ ​ ​ The first storage unit is configured to store document semantic metadata information added in the target streaming document in the form of semantic annotation as a semantic annotation record, the document semantic metadata information being generated by the following steps: obtaining at least one document base description information and at least one document entity object for the target streaming document as a semantic annotation element set; generating semantic element labels and semantic representation contents in a target format corresponding to each semantic annotation element in the semantic annotation element set as semantic annotation information by using a target mode, to obtain a semantic annotation information set; generating document semantic metadata information for the semantic annotation information set according to a semantic element hierarchy corresponding to each semantic annotation element in the semantic annotation element set; The second storage unit is configured to store the target streaming document and the semantic annotation record correspondingly to obtain a semantic streaming document; The writing unit is configured to write semantic contents of the semantic annotation information set of the semantic annotation record in the semantic streaming document into a target format semantic metadata file in response to detecting a first document format conversion operation for the semantic streaming document, wherein the target format semantic metadata file is stored in a pre-defined format semantic annotation record format; The document conversion unit is configured to convert the target streaming document included in the semantic streaming document into a target format document; The fusion unit is configured to fuse the target format semantic metadata file and the target format document to generate a semantic document in the target format as a semantic format document.

Citation Information

Patent Citations

  • Method for converting UOT streaming document into OFD format document

    CN111881651A