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

Aylien API added #437

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
36 changes: 36 additions & 0 deletions New_APIs/Aylien_API/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 🧠 AYLIEN Text Analysis API

## Overview

The **AYLIEN Text Analysis API** provides advanced text analysis capabilities, including entity extraction, sentiment analysis, and language detection. This API helps developers build applications that understand and interpret text data efficiently.

## Features

- **Entity Extraction**: Identify and extract entities such as people, places, and organizations from text.
- **Sentiment Analysis**: Analyze the sentiment of text to determine whether it's positive, negative, or neutral.
- **Language Detection**: Detect the language of the input text.
- **Text Classification**: Classify text into predefined categories.

## Getting Started

### Prerequisites

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

### Installation

To use the AYLIEN Text Analysis API in a web application, you can make HTTP requests to the API endpoint directly. Here’s an example setup:

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 AYLIEN API endpoint (`https://api.aylien.com/api/v1/`).

3. **Sample Request**:
```bash
curl -X POST https://api.aylien.com/api/v1/sentiment \
-H 'Content-Type: application/json' \
-H 'X-AYLIEN-TextAPI-Application-Key: YOUR_API_KEY' \
-H 'X-AYLIEN-TextAPI-Application-ID: YOUR_APP_ID' \
-d '{"text": "Your sample text here"}'
### contributor
### Amrutha Pariprolu
23 changes: 23 additions & 0 deletions New_APIs/Aylien_API/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AYLIEN API App</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<header>
<h1>AYLIEN 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>
38 changes: 38 additions & 0 deletions New_APIs/Aylien_API/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const apiKey = 'YOUR_API_KEY'; // Replace with your AYLIEN API key
const appId = 'YOUR_APP_ID'; // Replace with your AYLIEN App ID
const endpoint = 'https://api.aylien.com/api/v1/sentiment';

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/json',
'X-AYLIEN-TextAPI-Application-Key': apiKey,
'X-AYLIEN-TextAPI-Application-ID': appId
},
body: JSON.stringify({ text: text })
})
.then(response => response.json())
.then(data => {
const resultsContainer = document.getElementById('results');
resultsContainer.innerHTML = '';
if (data.polarity) {
resultsContainer.innerHTML = `
<h3>Sentiment Analysis:</h3>
<p><strong>Polarity:</strong> ${data.polarity}</p>
<p><strong>Subjectivity:</strong> ${data.subjectivity}</p>
`;
} else {
resultsContainer.innerHTML = '<p>No results found.</p>';
}
})
.catch(error => {
console.error('Error fetching text analysis results:', error);
const resultsContainer = document.getElementById('results');
resultsContainer.innerHTML = '<p>An error occurred while fetching text analysis results.</p>';
});
}
});
20 changes: 20 additions & 0 deletions New_APIs/Aylien_API/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "AYLIEN API App",
"short_name": "AYLIEN 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/Aylien_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/Aylien_API/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "aylien-api-app",
"version": "1.0.0",
"description": "A simple web app that integrates with AYLIEN Text Analysis API for text analysis functionality.",
"main": "index.js",
"scripts": {
"start": "echo 'No start script defined'"
},
"keywords": [
"text",
"analysis",
"aylien",
"api",
"web"
],
"author": "Amrutha",
"license": "MIT"
}
64 changes: 64 additions & 0 deletions New_APIs/Aylien_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