This is a repository for my diploma thesis which presents the creation of an end-to-end semantic communications framework for sending and receiving text data. The creation of this framework involves the implementation of models that undertake the extraction of semantic information of a text and the usage of a model to reconstruct semantic information.
In order to achieve the extraction of the semantic information of a text, I implemented the following models:
- Named Entity Recognition
A NER model was implemented by fine tuning the DistilBERT model on the OntoNotes dataset for token classification. That is shown at nerbert.py.
- Relation Classification
A relation classification (or relation extraction) model was implemented by fine tuning the DistilBERT model on the T-Rex dataset for sequence classification. That is shown at rebert.py.
The models are then used sequentially to extract semantic information following the pipeline approach.
The detailed steps followed to extract semantic information are the following;
- Coreference resolution
- Separating text into sentences
- NER for each sentence
- Creating entity pairs
- Entity tagging using head and tail markers
- Relation classification for each entity pair
- Semantic triple creation
- Adding semantic triple inside a list containing all the semantic triples of the text
The receiver generates coherent text based on the semantic triples he received.
This is achieved through prompting the large language model flan-t5. The prompt that is used is: "Translate the following triples into text: (list of triples)".
- Perform semantic information extraction with triples_extraction.py
- Perform semantic information reconstruction with triples_to_text_llm.py
The following video demonstrates the usage of the framework for sending and receiving text data:
See the LICENSE file for license rights and limitations.