Skip to content

This repository is for Master Thesis: Optimizing Domain-specific Regulation Comparison Process with Semantic Text Matching and Relation Extraction Approaches

Notifications You must be signed in to change notification settings

sitongye/Master_Thesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimizing Domain-specific Regulation Comparison with Semantic Text Matching & Relation Extraction

Introduction

This repository is for the source codes of master thesis: "Optimizing Domain-specific Regulation Comparison with Semantic Text Matching & Relation Extraction", the goals of which is to examine the potential for Natural Language Processing technologies to optimize current manual regulation maintenance process in an automotive manufacturer enterprise and proposes concepts of architecture and implementation of a text-matching as well as a relation extraction mechanism that integrates entity recognition to extract key information that is interested by experts from the regulations that could accelerate the manual information processes.

The source codes consists of following two parts:

Part 1: Paragraph Matching

The directory includes following files:

  • main
    • CorpusGenerator.py
    • config
      • config.yml
    • trained models
    • para_similarity.py
    • TW_EU_tf_idf.py
    • TW_EU_LSI.py
    • TW_EU_w2v.py
    • TW_EU_d2v.py
    • Evaluate.py
    • evaluation_plot.ipynb

user guide:

Paragraph matching mechanism supports four alternive text representation approaches:

  1. TF-IDF
  2. LSI
  3. word2vec
  4. doc2vec

correspondent configurations can be done under config YAML file in config directory. Supported Configuations include:

  1. File location
  2. data folder
  3. document pairing file folder
  4. result output folder
  5. groud truth folder
  6. list of approaches that need to be generated in one execution
  7. Preprocessing approaches (boolean values)
  8. bigram / trigram
  9. porter stemming / wordnet lemmatization
  10. Modeling For each approach:
  11. parameters
  12. similarity metrics 1. cosine similarity 2. word mover distance
  13. if the embedding needs to be pretrained

an example can be seen under example config


Part 2: Relation Extraction

modelling of relation extration consists of following steps:

  1. Recognition of defined "Quantitative Value" Entity: pretrained customized SpaCy model under "ner" folder
  2. extraction of tokens with "noun" as Part of Speech under same tree in dependency parsing with named entity in the last step and pairing with named entity
  3. classification of above entity pairs into four defined classes: MinValue, MaxValue, IsValue, NoRelation

The architecture is summarized as follow:

A model consisting of BERT embedding and Bi-LSTM is trained by train.py by calling help functions in Relation_Extraction.py Demo is available at [example config](relation_extraction/Relation Extraction.ipynb)

About

This repository is for Master Thesis: Optimizing Domain-specific Regulation Comparison Process with Semantic Text Matching and Relation Extraction Approaches

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published