Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwajeetk87 authored Nov 22, 2019
1 parent ea33a25 commit 76c9fa8
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# text_compare
# text_compare

**Background**:
text_compare is a service which will compare given two input texts and return the Match count and Match score.

Match Count: common Subsequence between two texts
Match score: Score will range between 0 and 1 where 0 is no match and 1 will be the exact match.

The comparison logic makes use of Longest common subsequence algorithm to find the match.

Metric used for comparison is simple , score is calculated using formula (length_of subsequence)/max(len_of_text1,len_of_text2)


**Running the Application**:

This application is using flask to create an endpoint ,the starting point for application is core.py simply execute following to start the app.

- python core.py

- URL for POST method : http://localhost/compare/
- Payload is in json format : -d '{"text1":"foo bar", "text2":"bar"}'

- Result
{
Match Count : 1,
Match Score : 0.5
}

- This application was tested using POSTMAN

Sample Curl
curl -X POST \
http://127.0.0.1:5000/compare/ \
-H 'content-type: application/json' \
-d '{"text1":"foo bar", "text2":"bar"}'

0 comments on commit 76c9fa8

Please sign in to comment.