File size: 1,966 Bytes
db4a849
 
 
 
 
 
836e6dc
db4a849
 
 
 
 
 
e36317e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
title: Openalex Topic Classification
emoji: 🏢
colorFrom: pink
colorTo: red
sdk: gradio
sdk_version: 5.23.1
app_file: app.py
pinned: false
license: mit
short_description: OpenAlex/bert-base-multilingual-cased-finetuned-openalex-top
---

# OpenAlex Topic Classification

This application allows you to classify academic texts into different topics using machine learning models trained with OpenAlex data.

## Features

- Classification of academic texts into multiple topics
- Uses two different models for more robust classification
- Easy-to-use web interface
- Support for structured title and abstract format

## Requirements

- Python 3.7+
- Gradio 5.23.1
- Transformers (Hugging Face)

## Installation

```bash
pip install -r requirements.txt
```

## Usage

1. Run the application:
```bash
python app.py
```

2. Open your browser at the address shown in the console (usually http://localhost:7860)

3. Enter your text in the format:
```
<TITLE> Your title here
<ABSTRACT> Your abstract here
```

4. Select the number of classifications you want to see (top_k)

5. Click "Submit" to get the results

## Models

The application uses two different models:
1. [OpenAlex/bert-base-multilingual-cased-finetuned-openalex-topic-classification-title-abstract](https://huggingface.co/OpenAlex/bert-base-multilingual-cased-finetuned-openalex-topic-classification-title-abstract)
   - Based on BERT multilingual model
   - Fine-tuned on OpenAlex data
   - Supports multiple languages

2. [albertmartinez/openalex-topic-classification-title-abstract](https://huggingface.co/albertmartinez/openalex-topic-classification-title-abstract)
   - Based on BERT multilingual model
   - Fine-tuned on OpenAlex data (https://huggingface.co/datasets/albertmartinez/openalex-topic-title-abstract)
   - Supports multiple languages

## License

MIT

## References

- [OpenAlex](https://openalex.org/)
- [Hugging Face Spaces](https://huggingface.co/docs/hub/spaces-config-reference)