Yes, there are Hugging Face Spaces where you can test models based on LayoutLMv3, including variants fine-tuned for sequence labeling tasks (e.g., via LayoutLMv3ForTokenClassification, which is used for token-level tasks like named entity recognition or semantic labeling in documents). LayoutLMv3 is a multimodal model from Microsoft for document understanding, and it's well-supported on the Hugging Face Hub.
I'll break this down with options, recommendations, and steps to get you started.
Recommended Hugging Face Spaces for LayoutLMv3 Testing
Hugging Face Spaces are community-driven demos, so availability can change, but here are some relevant ones I've verified (as of my last knowledge update):
nielsr/layoutlmv3-funsd (Best for Sequence Labeling Demo):
Description: This space demonstrates LayoutLMv3 fine-tuned on the FUNSD dataset for semantic entity labeling (a sequence labeling task). You can upload a document image (e.g., a form or receipt), and it will predict labels for entities like "question", "answer", "header", etc., at the token level. It's a great way to test LayoutLMv3ForTokenClassification in action.
How to Use:
Visit the space.
Upload an image of a document (it supports formats like JPG/PNG).
The model processes it (including OCR if needed) and outputs labeled bounding boxes and predictions.
It's interactive and free to use (runs on Hugging Face's inference API).
Model Used: Based on microsoft/layoutlmv3-base fine-tuned for FUNSD.
Limitations: It's specific to FUNSD-style labeling; if your use case is different (e.g., custom NER), you might need to fine-tune further.
Description: Similar to the FUNSD demo, but fine-tuned on the CORD dataset (receipts). It performs sequence labeling for entities like menu items, prices, and totals. Again, this uses LayoutLMv3ForTokenClassification.
Why Useful: Good for testing on receipt-like documents.
Other Related Spaces:
layoutlm-document-qa (by impira): huggingface.co/spaces/impira/layoutlm-document-qa – This is more for question-answering (sequence classification), but it's built on LayoutLM and can be a starting point if you want to explore document AI.
Search for More: Go to huggingface.co/spaces and search for "LayoutLMv3" or "document labeling". Community contributors like Niels Rogge (nielsr) often create high-quality demos for these models.
If none of these exactly match your needs (e.g., you want a custom sequence labeling task), you can easily create your own Space or use the Hugging Face Inference API.
How to Test LayoutLMv3ForSequenceLabeling Yourself
If the pre-built Spaces aren't sufficient, here's how to experiment directly:
Search for "layoutlmv3 token classification" on the Hub for more.
Run Inference in a Notebook:
Use Google Colab or Jupyter Notebook with the Transformers library.
Install dependencies: !pip install transformers pillow pytesseract (Pytesseract for OCR if needed).
Example code snippet for sequence labeling (adapt from the model card):
python
from transformers import LayoutLMv3Processor, LayoutLMv3ForTokenClassification
from PIL import Image
import torch
# Load model and processor
processor = LayoutLMv3Processor.from_pretrained("microsoft/layoutlmv3-base", apply_ocr=True) # Set apply_ocr=False if you have pre-extracted text
model = LayoutLMv3ForTokenClassification.from_pretrained("Theivaprakasham/layoutlmv3-base-funsd") # Or your fine-tuned model
# Load an image
image = Image.open("your_document_image.jpg")
# Prepare inputs (handles text extraction and bounding boxes)
encoding = processor(image, return_tensors="pt")
# Inference
outputs = model(**encoding)
logits = outputs.logits
predictions = torch.argmax(logits, dim=2)
# Decode predictions (map to labels)
labels = processor.tokenizer.batch_decode(predictions) # Adjust based on your label map
print(labels)
This will give you token-level labels. You can visualize bounding boxes using libraries like matplotlib.
Additional Tips
Performance: These models require document images with text and layout info. They work best on scanned forms, invoices, or receipts.
Limitations: LayoutLMv3 needs bounding box info (often auto-generated via OCR). If your documents are complex, you might need to fine-tune on your data using the Datasets library.
Alternatives if No Exact Match: If you can't find a Space, check out DocTR or other document AI Spaces on Hugging Face for similar functionality.
Community Help: Post on the Hugging Face Forums or search the model discussions for more demos. If a Space goes down, the community often recreates them.
If this doesn't cover what you're looking for (e.g., a specific dataset or task), provide more details, and I can refine my suggestions!
Create Your Own Hugging Face Space:
If you want a custom demo, fork an existing Space (e.g., from nielsr) or create one from scratch using Gradio (easy UI library).