Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textrazor added #433

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions New_APIs/TextRazor_API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 🧠 TextRazor API

## Overview

The **TextRazor API** provides powerful text analysis capabilities, allowing developers to extract insights and data from text. This API enables users to perform tasks such as entity extraction, sentiment analysis, and language detection, making it a valuable tool for applications that need to understand and process textual data.

## Features

- **Entity Extraction**: Identify and extract entities such as people, places, organizations, and more from text.
- **Topic Extraction**: Automatically categorize and label text based on topics and themes.
- **Sentiment Analysis**: Analyze the sentiment expressed in the text, determining whether it is positive, negative, or neutral.
- **Language Detection**: Detect the language of the input text.
- **Customizable**: Tailor the extraction and analysis to specific needs using custom configurations.

## Getting Started

### Prerequisites

- **API Key**: You will need an API key to access the TextRazor API. You can obtain an API key by [signing up](https://www.textrazor.com/) on the TextRazor website.

### Installation

To use the TextRazor API in a web application, you can make HTTP requests to the API endpoint directly. Here’s an example of how to set it up in a basic HTML/JavaScript application:

1. **Obtain Your API Key**: After signing up, you will receive an API key.

2. **Make API Requests**: Use the API key to authenticate your requests to the TextRazor API endpoint (`https://api.textrazor.com/`).

3. **Sample Request**:
```bash
curl -X POST https://api.textrazor.com/ \
-H 'x-textrazor-key: YOUR_API_KEY' \
-d 'text=Your sample text here&extractors=entities,topics'
### Contributor
### Amrutha Pariprolu
25 changes: 25 additions & 0 deletions New_APIs/TextRazor_API/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

### `index.html`
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TextRazor API App</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>TextRazor API App</h1>
</header>
<main>
<form id="text-form">
<textarea id="text-input" placeholder="Enter text to analyze..."></textarea>
<button type="submit">Analyze</button>
</form>
<div id="results"></div>
</main>
<script src="index.js"></script>
</body>
</html>
39 changes: 39 additions & 0 deletions New_APIs/TextRazor_API/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const apiKey = 'YOUR_TEXTRAZOR_API_KEY'; // Replace with your TextRazor API key
const endpoint = 'https://api.textrazor.com/';

document.getElementById('text-form').addEventListener('submit', function(event) {
event.preventDefault();
const text = document.getElementById('text-input').value;
if (text) {
fetch(endpoint, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'x-textrazor-key': apiKey
},
body: new URLSearchParams({
'text': text,
'extractors': 'entities,topics'
})
})
.then(response => response.json())
.then(data => {
const resultsContainer = document.getElementById('results');
resultsContainer.innerHTML = '';
if (data.response && data.response.entities) {
const entities = data.response.entities.map(entity => `
<div class="result-item">
<h2>${entity.type}</h2>
<p>${entity.mention}</p>
</div>
`).join('');
resultsContainer.innerHTML = `<h3>Entities:</h3>${entities}`;
} else {
resultsContainer.innerHTML = '<p>No entities found.</p>';
}
})
.catch(error => {
console.error('Error fetching text analysis results:', error);
});
}
});
20 changes: 20 additions & 0 deletions New_APIs/TextRazor_API/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "TextRazor API App",
"short_name": "TextRazor App",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#000000",
"icons": [
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}
13 changes: 13 additions & 0 deletions New_APIs/TextRazor_API/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions New_APIs/TextRazor_API/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "textrazor-api-app",
"version": "1.0.0",
"description": "A simple web app that integrates with TextRazor API for text analysis functionality.",
"main": "index.js",
"scripts": {
"start": "echo 'No start script defined'"
},
"keywords": [
"text",
"analysis",
"textrazor",
"api",
"web"
],
"author": "Amrutha",
"license": "MIT"
}
64 changes: 64 additions & 0 deletions New_APIs/TextRazor_API/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
body {
font-family: Arial, sans-serif;
background-color: #f5f5f5;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
}

header {
background-color: #000;
color: #fff;
width: 100%;
text-align: center;
padding: 10px;
}

main {
margin-top: 20px;
width: 80%;
max-width: 800px;
}

#text-form {
display: flex;
flex-direction: column;
align-items: center;
}

#text-input {
width: 100%;
height: 150px;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
resize: vertical;
}

button {
padding: 10px 20px;
border: none;
background-color: #007bff;
color: #fff;
border-radius: 4px;
cursor: pointer;
}

button:hover {
background-color: #0056b3;
}

.result-item {
margin-bottom: 20px;
}

.result-item h2 {
margin: 0;
}

.result-item p {
margin: 5px 0;
}
Loading