Provided in the embodiments of the present disclosure are a
data processing method and apparatus, and a
document processing method and apparatus. The
data processing method comprises: determining from a visual object a plurality of visual
layout elements and data representations of a plurality of pieces of visual data of the visual object; performing attention
processing on the data representation of each piece of visual data and the data representations of the plurality of pieces of visual data, so as to obtain a
context data representation of each piece of visual data; on the basis of the
context data representation of each piece of visual data and an association relationship between each piece of visual data and the plurality of visual
layout elements, determining an element representation of each visual
layout element; and on the basis of the element representation of each visual layout element, determining, from among the plurality of visual layout elements, an associated visual layout element corresponding to each visual layout element. Therefore, element representations of visual layout elements including fine-grained context are obtained, such that the accuracy of predicting an association relationship between the visual layout elements is improved.