Skip to content

Commit 88bbc0d

Browse files
Merge pull request #1459 from subhradip-bo/subhradip_branch
Updated the readme file for Plagiarism checker.
2 parents 7f57884 + 062300d commit 88bbc0d

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

Plagiarism-Checker/README.md

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
<h3 align="center">Plagiarism Checker</h3>
1+
<h1 align="center">Plagiarism Checker</h1>
22

3-
## How it works <br><br>
4-
- In order to compute the simlilarity between two text documents, the textual raw data is transformed into vectors.
5-
- Then it is transformed into arrays of numbers and then from that by using a basic knowledge vector to compute the the similarity between them.
3+
## Introduction <br>
4+
- Plagiarism checking/detection is the identification of similarities between texts and establishing if one text is derived from another, and it may be used to spot situations of academic dishonesty or unauthorised copying.
5+
- This code analyses the textual data and looks for possible instances of plagiarism using TF-IDF (Term Frequency-Inverse Document Frequency) vectorization and cosine similarity.
66

7-
## Dependencies<br>
8-
- Install scikit-learn by:
7+
## Prerequisites <br>
8+
- Install scikit-learn by: '**$ pip install scikit-learn**'
99

10-
$ pip install scikit-learn
10+
## How it works <br>
11+
1. There are four text documents in the repository.
12+
2. The paths to text files that are located in the same directory as the code file are loaded at the beginning of the code. It recognises and records the paths of all files with the **.txt** extension in the **student_files** list.
13+
3. Next, the code reads the contents of each text file and stores them in the **student_notes** list.
14+
4. **The TfidfVectorizer** class from scikit-learn is used by the **vectorize** function to perform TF-IDF vectorization on a list of text documents. The relative relevance of each term in a document in relation to the corpus of texts is captured by the TF-IDF, a numerical representation of textual data. The function returns arrays of numbers that represent the documents' TF-IDF vectors.
15+
5. The **similarity** function computes the cosine similarity between two document vectors. Cosine similarity measures the cosine of the angle between two vectors and is commonly used to compare the similarity of documents represented as vectors. The function returns the similarity score between the two input vectors.
16+
6. The code with the help of the **vectorize** function vectorizes the textual data, converting it to numerical arrays using TF-IDF representation.
17+
7. The vectorized data is then paired with their corresponding student files and stored in the **s_vectors** list.
18+
8. The **check_plagiarism** function compares the vectorized documents of each pair of students using cosine similarity. It iterates through each student's vector and compares it with the vectors of all other students. For each pair of students, it computes the similarity score using the **similarity** function and stores the student pair and their similarity score in the **plagiarism_results** set.
19+
9. And at last the code loops through the **plagiarism_results** set and prints the student pairings along with their similarity ratings.
1120

12-
## Running the app <br>
13-
- There are four text documents in the repository.
14-
- Basically the code will compare all the .txt files and check for any similarity.
21+
- $ python plagiarism.py
1522

16-
$ python plagiarism.py
23+
## Notes <br>
24+
- Please make sure the text files are readable and contain textual processable data.
25+
- The text files must be in the same directory as the code file.
26+
- If not need to provide the appropriate path in the **student_files** section of the code.
1727

1828
## Screenshots
1929
<img src="https://raw.githubusercontent.com/Anupreetadas/plagiarism_checker/main/assets/Capture1.PNG" width="100%" height="100%" align="left" >

0 commit comments

Comments
 (0)