Giter Site home page Giter Site logo

natural-language-inference-using-llm's Introduction

Natural-Language-Inference-Using-LLM

This repository contains the source code for fine-tuning BERT for the natural language inference task.

Natural Language Inference (NLI) is a fundamental task in natural language processing (NLP) that involves determining the logical relationship between two given sentences. The goal is to determine whether the relationship is "entailment," "contradiction," or "neutral."

The Stanford Natural Language Inference (SNLI) dataset is a widely used benchmark for NLI tasks. It consists of a large collection of sentence pairs, each labeled with one of the three aforementioned relationships. The dataset is manually annotated, making it a reliable resource for evaluating NLI models. In the SNLI dataset, each sentence pair consists of a premise and a hypothesis. The premise is a statement or a sentence that serves as the context, while the hypothesis is another sentence that needs to be evaluated against the premise. The task is to determine whether the hypothesis can be inferred from the premise (entailment), contradicts the premise (contradiction), or has no relationship with the premise (neutral).

For example, consider the following sentence pair from the SNLI dataset:

Premise: "A young boy playing soccer in the park." Hypothesis: "A child is outside playing a sport."

In this case, the relationship between the premise and hypothesis is entailment, as the hypothesis can be inferred from the premise. NLI models aim to learn patterns and linguistic cues to accurately classify such relationships.

In this project, BERT was fine-tuned on the SNLI dataset.

Language Model used: BERT-BASE-UNCASED

Modeling the task for training:

[CLS] Premise [SEP] Hypothesis [SEP]

A classification head was added on top of the BERT model to make the prediction.

natural-language-inference-using-llm's People

Contributors

raigon44 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.