10. A system for processing an electronic document, the system comprising: one or more processors; one or more non-transitory computer-readable storage media storing sequences of instructions which, when executed by the one or more processors, cause the one or more processors to: receive the electronic document; generating an initial codification of the electronic document, the initial codification of the electronic document comprising a plurality of canonical feature codifications, each canonical feature codification comprising a plurality of attribute values describing attributes of the canonical feature as it appears in the electronic document; accessing a reference set of reference document codifications; for each reference document codification in the reference set, determining a similarity between the reference document codification and the initial codification of the electronic document; generating a comparison set of reference document codifications by including at most a threshold number of reference document codifications that are determined to be the most similar to the initial codification of the electronic document, each reference document codification in the comparison set comprising a plurality of canonical feature codifications, each canonical feature codification comprising a plurality of attribute values describing a position of the canonical feature in the reference document; process each canonical feature codification in each reference document codification in the comparison set by: determining whether the electronic document has one or more text rectangles in a potential position of the canonical feature, the potential position of the canonical feature defined with reference to the attribute values of the canonical feature in the canonical feature codification; and in response determining that the electronic document has one or more text rectangles in a potential position of the canonical feature, recording a preliminary association between the text rectangle and the canonical feature; and for each text rectangle preliminarily associated with one or more canonical features, determine a final canonical feature assignment for the text rectangle, the final canonical feature assignment being determined based on the one or more canonical features preliminarily associated with the text rectangle.
18. The system according to claim 10 , wherein when executed, the sequences of instructions further cause the one or more processors to extract data in respect of at least one canonical feature from the electronic document by: identifying a text rectangle with a final canonical feature assignment; and extracting the text from the identified text rectangle as the canonical feature assigned to that text rectangle.