Source-linked AI summary

Text Matching as Image Recognition

Liang Pang, Yanyan Lan, Jiafeng Guo, Jun Xu, Shengxian Wan, Xueqi Cheng

arXiv:1602.06359v1cs.CLcs.AI

TL;DR

Text matching must identify meaningful interactions across words, phrases, and sentences. The paper models these interactions as image recognition by constructing a word-similarity matrix and applying CNNs layer by layer. MatchPyramid captures patterns such as n-gram and n-term matches and outperforms baselines, with semantic representations helping on citation matching.

  • Problem

    Automatically finding and using hierarchical interaction patterns in text matching remains challenging.

  • Method

    MatchPyramid views text matching as image recognition by applying CNNs to a matching matrix whose entries represent word similarities.

  • Results

    MatchPyramid captures unigram, n-gram, and n-term patterns at different levels and outperforms baselines, while real-valued matching performs best when semantic representations matter.

  • Takeaways & Limitations

    Modeling matching as hierarchical interaction-pattern recognition provides a deep architecture for capturing signals from words through sentences.

  • Takeaways & Limitations

    An indicator-based matching function captures exact word matches but omits semantic similarity.

Abstract

from arXiv · show

Matching two texts is a fundamental problem in many natural language processing tasks. An effective way is to extract meaningful matching patterns from words, phrases, and sentences to produce the matching score. Inspired by the success of convolutional neural network in image recognition, where neurons can capture many complicated patterns based on the extracted elementary visual patterns such as oriented edges and corners, we propose to model text matching as the problem of image recognition. Firstly, a matching matrix whose entries represent the similarities between words is constructed and viewed as an image. Then a convolutional neural network is utilized to capture rich matching patterns in a layer-by-layer way. We show that by resembling the compositional hierarchies of patterns in image recognition, our model can successfully identify salient signals such as n-gram and n-term matchings. Experimental results demonstrate its superiority against the baselines.

Introduction

Text matching requires modeling hierarchical interactions from words through phrases to sentences. MatchPyramid treats matching as image recognition, using a matching matrix and CNN to capture these patterns, with experiments showing superiority over baselines.

  • Introduction: Text matching scores typically model interactions between two text representations through a scoring function.Texts are represented as word sequences, while Φ maps each text to a vector and F models interactions between them.
  • Introduction: Hierarchical signals combine identical and similar word matches into n-gram, unordered n-term, semantic n-term, and sentence-level patterns.Examples include “down the ages,” reordered “noodles and dumplings,” and semantically related “famous Chinese food” and “popular in China.”
  • Introduction: MatchPyramid constructs a word-level matching matrix and applies CNN layers to capture matching patterns from words and phrases to whole sentences.The matrix may be binary or real-valued, while convolution captures n-gram and n-term patterns through layer-by-layer abstraction.
  • Introduction: MatchPyramid with a 0-1 matching matrix outperforms baselines on paraphrase identification using only interactions between texts.The result is reported for paraphrase identification specifically.
  • Introduction: MatchPyramid with a real-valued matching matrix performs best on paper citation matching by combining interactions with semantic representations.Real-valued similarities address tasks where semantic information is important.
  • Introduction: The paper contributes a new image-recognition view of text matching and a deep architecture that captures patterns at multiple levels.Experiments across different tasks compare the architecture with competitor matching algorithms.

Motivation

Text matching contains compositional interaction structures analogous to hierarchical visual patterns. The paper uses this analogy to motivate CNN-based processing, while recognizing that text sequences and image grids have different representations.

  • Motivation: Interaction structures in text matching extend from word-level signals to phrase-, sentence-, and paragraph-level signals.Sentence signals compose multiple phrase signals, and paragraphs can be treated as long sentences.
  • Motivation: Word-level matching includes both identical matches, such as “down–down,” and similar matches, such as “famous–popular.”These signals provide the basic interactions from which higher-level patterns are composed.
  • Motivation: Phrase-level signals include n-gram matches and n-term matches that allow word-order or semantic alternatives.Examples include identical “down the ages,” reordered “noodles and dumplings,” and semantically related phrases.
  • Motivation: Text matching and image recognition both form higher-level signals by composing lower-level units into increasingly complex structures.Images compose pixels into edges, motifs, parts, and objects, while text composes word interactions into phrase and sentence signals.
  • Motivation: CNNs motivate the transformation of text matching into image recognition because they capture different levels of visual patterns.The transformation remains challenging because text consists of two one-dimensional word sequences rather than a two-dimensional pixel grid.

MatchPyramid

MatchPyramid models text matching as image recognition by converting word similarities into a matching matrix and applying hierarchical convolution to capture patterns from phrases to sentences.

  • MatchPyramid: MatchPyramid views the matching matrix as an image and uses a deep architecture to model text matching.Each matrix entry represents a word-level interaction between the two texts.
  • Matching Matrix: Indicator matching produces binary matrices by assigning 1 to identical word pairs and 0 otherwise.The indicator function cannot capture semantic matching between similar words.
  • Matching Matrix: Embedding-based cosine and dot-product operators provide real-valued matching matrices that capture semantic interactions.Cosine measures angular similarity, while dot product additionally considers vector norms.
  • Matching Score and Training: Dynamic pooling handles variable text lengths, and further convolution and max-pooling produce fixed-size higher-level feature maps.The resulting hierarchical convolution output is passed to an MLP that produces the final matching score.
  • Hierarchical Convolution: Hierarchical convolution composes lower-level word matching signals into phrase- and sentence-level patterns.The first layer can detect n-gram and n-term signals, while later layers form more complicated patterns.

Experiments

Experiments evaluate MatchPyramid on paraphrase identification and paper citation matching, comparing its variants with traditional and deep baselines. Results also analyze learned representations and feature maps to explain the model’s matching behavior.

  • Experimental setup: Experiments cover paraphrase identification and paper citation matching, using MatchPyramid variants and several traditional and deep baselines.The model variants are MP-IND, MP-COS, and MP-DOT.
  • Paraphrase identification: The MSRP paraphrase-identification experiment uses 4,076 training instances and 1,725 testing instances.Results are reported in Table 1.
  • Paraphrase identification: MatchPyramid variants outperform the compared deep models on MSRP, although the best result, 75.94%/83.01%, is slightly below URAE’s 76.8%/83.6%.The paper attributes URAE’s advantage partly to pretraining with external parse-tree-annotated data.
  • Model analysis: Feature-map analysis shows first-layer kernels capturing n-gram and n-term signals, while later layers compose and preserve useful matching patterns for classification.The visualization represents n-gram and n-term matches as colored diagonal submatrices; brighter pixels indicate larger values.
  • Paper citation matching: The citation-matching dataset contains 838,908 text pairs, split into 599,196 training, 119,829 validation, and 119,883 testing instances.Positive instances are citation-related pairs, while negatives are randomly sampled non-citation papers; abstracts are truncated to their first 32 words.
  • Paper citation matching: MP-DOT achieves the best citation-matching performance at 88.73%/82.86%, exceeding ARC-II’s 86.84%/79.57%.MP-COS also outperforms ARC-II, while TF-IDF remains a strong baseline on this dataset.

Related Work

Related text-matching methods differ in how they represent texts and model interactions. MatchPyramid instead uses word-level matching and hierarchical convolution to capture interactions across levels.

  • Representation-based methods: Earlier methods commonly learn representations for individual texts and apply a simple scoring function to obtain matching results.Examples include PLS, CCA, DSSM, CDSSM, and ARC-I.
  • Interaction-based methods: Interaction-focused methods model relationships between two sentences more directly, including DEEPMATCH, URAE, and ARC-II.The paper positions MatchPyramid within this category.
  • Comparisons: DEEPMATCH uses topic-level interactions and hierarchical abstractions, whereas MatchPyramid defines interactions at the word level.The paper notes that topic relationships may be relatively rough or ambiguous compared with word-level matching.
  • Comparisons: URAE builds interactions from syntactic trees and inserts multiple interaction levels into one matrix, while MatchPyramid is end-to-end and hierarchically captures them.URAE relies on predefined compact vectorial text representations.
  • Comparisons: ARC-II interleaves two texts early and abstracts sentence-level interactions, but its sum operation makes the exact interactions unclear.ARC-I postpones interaction until the end of processing.

Conclusion

The paper presents MatchPyramid as an image-recognition approach to text matching. It reports that the architecture captures matching patterns across words, phrases, and sentences and outperforms baseline methods.

  • Conclusion: MatchPyramid views text matching as image recognition and uses a deep architecture to capture unigram, n-gram, and n-term patterns at different levels.The paper reports that MatchPyramid outperforms baseline methods, including recently proposed deep matching algorithms.
Loading 1602.06359v1…