Forum Discussion
How to do the Machine Model application in Fabric?
Hi kirah2128 ,
Thanks for using Fabric Community.
Did you got any chance to look into this doc - Machine learning model - Microsoft Fabric | Microsoft Learn
Hope this is helpful. Do let me know incase of further queries.
Hi, the link is not helpful.
What I want to achieve is to deploy now the model. There's a wizard option but that's not gonna work if the input is converted to other data types. in my Case its TensorFlow data type.; I attached the picture below for your ref.
- Anonymous2 years agoNot applicable
Hi kirah2128 ,
Can you please check your input data and also the version configuration from your end once?
Do let me know incase of further queries.- kirah21282 years ago
Resolver I
This is the model
here is how I supply the ML with the new inputs from lakehouse source.
# Initialize Spark session spark = SparkSession.builder.getOrCreate() # Load data from your Spark SQL environment or DataFrame df = spark.sql("SELECT removal_reasons, reliability_tracked FROM lakehouse1.part_removal") # Initialize the tokenizer tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') # Tokenization function def tokenize_text(text): tokens = tokenizer(text, padding="max_length", truncation=True, max_length=128, return_tensors="np") return tokens['input_ids'][0].tolist(), tokens['attention_mask'][0].tolist() # Register UDF for tokenization @udf(ArrayType(IntegerType())) def udf_tokenize_input_ids(text): return tokenize_text(text)[0] @udf(ArrayType(IntegerType())) def udf_tokenize_attention_mask(text): return tokenize_text(text)[1] # Apply the UDF to add tokenized columns df = df.withColumn("input_ids", udf_tokenize_input_ids(col("removal_reasons"))) df = df.withColumn("attention_mask", udf_tokenize_attention_mask(col("removal_reasons"))) # Ensure the DataFrame has the correct format df = df.select("input_ids", "attention_mask", "reliability_tracked")- Anonymous2 years agoNot applicable
Hi kirah2128 ,
I was finf this link in Youtube - click here
It looks like some similar issue and he did some changes to make the code work.
Before -
After -
Can you please check the video and let me know if it is helpful.